pub struct Daemon { /* private fields */ }Expand description
A configured-but-not-yet-running sync daemon over one Config.
Implementations§
Source§impl Daemon
impl Daemon
Sourcepub fn new(config: Config, backends: Arc<dyn Backends>) -> Self
pub fn new(config: Config, backends: Arc<dyn Backends>) -> Self
Create a daemon for config with default DaemonOptions.
backends builds the concrete source/sink the engine drives; the daemon
itself never names a backend (see Backends). The composition root
supplies it.
pub fn with_options(self, options: DaemonOptions) -> Self
Sourcepub fn with_observer(self, observer: Arc<dyn Observer>) -> Self
pub fn with_observer(self, observer: Arc<dyn Observer>) -> Self
Sourcepub fn with_status(self, status: Arc<Status>) -> Self
pub fn with_status(self, status: Arc<Status>) -> Self
Provide the Status handle to update instead of minting a fresh one.
The binary uses this to keep one process-lifetime status across
pipeline restarts (e.g. an on-demand reindex): the long-lived HTTP surface
and metrics keep reading the same handle, and its counters and uptime
survive the restart rather than resetting. Without it, start
creates a new status each time.
Sourcepub async fn start(self) -> Result<RunningDaemon>
pub async fn start(self) -> Result<RunningDaemon>
Build the pipeline and its observable state, returning a RunningDaemon
whose status can be read (e.g. served over HTTP)
while it runs.
If an attached observer (via with_observer) records
to the global OpenTelemetry meter, install a meter provider before calling
this; otherwise its instruments are no-ops.