Expand description
Daemon-side state, worker loop, and connection task. Decoupled from socket I/O so the queue and dispatch logic can be unit-tested with plain method calls.
Structs§
- Broadcast
Sink - Daemon-side JobSink that translates every call into an Event and broadcasts it. Cheap to construct per job.
- Daemon
State - JobNot
Found - Queued
Job - One unit of work waiting to run. The
requestcarries the parameters;priorityis also reflected here so the queue can rebalance onTogglePrioritywithout re-reading the Request. - Replay
Buffer - Per-job ring of
Events used to replay history whendaemon attachtargets a finished or in-flight job. Bounded both in jobs tracked (oldest job dropped when full) and in events per job (oldest event per job dropped when full). - Ring
Buffer - Running
Job
Functions§
- handle_
connection - Handle a single client connection. Reads exactly one Request, then either replies with a single Response and closes (control RPCs), or streams Events filtered by job id (job submissions, Subscribe, Attach) until terminated by JobFinished or a shutdown signal.
- spawn_
replay_ collector - Spawn the replay collector. The broadcast subscription is created synchronously before the task is spawned, so events emitted between the call to this function and the spawned task’s first poll are not lost.
- worker_
loop - Single-job worker loop. Holds the SteamClient lazily: it is acquired
on the first job that needs it and recreated after a connection-loss
error so subsequent jobs reauthenticate transparently.
preferred_useris forwarded into the lazy login flow.