amoorion.daemon.base¶
Daemon: runs services side by side until one ends or it is stopped.
A service is anything long-running: the API (which also receives the hooks) and a NATS subscriber now; platform listeners (Discord, Telegram, Matrix bots) later. When one service ends or fails, the others are stopped.
Functions
|
Run the daemon until stopped: |
|
The API always; NATS when |
Classes
|
The HTTP API with its hooks, as a service of the daemon. |
|
Runs the services together; when one ends, all are stopped. |
|
One long-running part of the daemon. |
- class amoorion.daemon.base.Service(view=None)[source]¶
Bases:
ControllerOne long-running part of the daemon. It runs until stopped; see
Daemon.- Parameters:
view (View | None)
- class amoorion.daemon.base.ApiService(host, port)[source]¶
Bases:
ServiceThe HTTP API with its hooks, as a service of the daemon.
- Parameters:
host (str)
port (int)
- class amoorion.daemon.base.Daemon(services)[source]¶
Bases:
ControllerRuns the services together; when one ends, all are stopped.
A half-working daemon is worse than a stopped one, as something restarts it from outside (systemd, a container).
- Parameters:
services (list[Service])