pub struct AimDbRunner { /* private fields */ }Expand description
Non-Clone runner returned alongside AimDb from
AimDbBuilder::build().
Owns the complete set of futures that drive the database (producer
services, consumer taps, transforms with fan-in forwarders, connectors,
remote-access supervisor, on_start tasks). run() consumes self,
drives every future cooperatively via a FuturesUnordered, and returns
only when every future has completed — typically never, since
producer/consumer loops run for the application’s lifetime.
Cancellation is the application’s responsibility — wrap runner.run()
in tokio::select! with a shutdown signal, or use a CancellationToken
inside each registered service.
Implementations§
Source§impl AimDbRunner
impl AimDbRunner
Sourcepub fn future_count(&self) -> usize
pub fn future_count(&self) -> usize
Returns the number of futures the runner will drive. Useful for tests and diagnostic logging.
Sourcepub async fn run(self)
pub async fn run(self)
Drives every collected future to completion.
Returns when all futures complete (normally: never, while producer and
consumer loops are alive). To cancel, wrap this call in tokio::select!
(or the analogous primitive on Embassy / WASM) with a shutdown signal —
when the select! arm fires, this future is dropped and every
FuturesUnordered entry is cancelled with it.