Skip to main content

Module runner

Module runner 

Source
Expand description

The background task that does the forwarding.

It follows the shape of the daemon’s other background workers (spawn_eviction_monitor, spawn_liveness_monitor): spawned once, driven by a poll interval, stopped by a CancellationToken. It additionally carries its own token so disable can stop forwarding without touching the daemon.

The ordering within a cycle is deliberate: poll, deliver, then persist offsets. Persisting before delivery would mean a daemon killed mid-cycle had already promised never to re-read events that never left the machine. Doing it after means a crash re-reads a little, which the deterministic document ids turn into harmless duplicates that the endpoint rejects with a 409.

Structs§

ForwarderHandle
Handle to a running forwarder.
ForwarderSnapshot
Live view of what the forwarder is doing, shared with the status endpoint.

Constants§

DEFAULT_POLL_INTERVAL
How often the forwarder looks for new log content.

Functions§

classify_nodes
Split the registry into nodes that can be forwarded and nodes that cannot.
spawn_log_forwarder
Start forwarding in the background.