pub struct ProcessWorkRunner { /* private fields */ }Expand description
Drives the registry’s non-terminal rows (the durable work queue) to terminal on poke, on a poll tick, and once at startup.
The registry non-terminal rows are the queue; a poke makes consumption
prompt. The single coordination point is the ProcessLease claimed inside
the ProcessRunHandle, so a poke is idempotent (a leased or terminal row
is skipped) and the same control seam can poke after any process start.
The loop is a tokio::select over a Notify (poke) and an interval
(poll), plus one startup drive that folds in the former startup-only
recovery sweep.
Implementations§
Source§impl ProcessWorkRunner
impl ProcessWorkRunner
Sourcepub fn new(run_handle: Arc<dyn ProcessRunHandle>) -> Self
pub fn new(run_handle: Arc<dyn ProcessRunHandle>) -> Self
Build a runner over the given ProcessRunHandle.
Sourcepub fn inline(worker: DurableProcessWorker) -> Self
pub fn inline(worker: DurableProcessWorker) -> Self
Build a runner that drives an inline DurableProcessWorker directly.
Sourcepub fn poke_handle(&self) -> ProcessWorkPoke
pub fn poke_handle(&self) -> ProcessWorkPoke
A cloneable poke handle that wakes the loop. Hand a clone to the control seam so a successful process start can make consumption prompt.
Sourcepub fn spawn(self) -> ProcessWorkPoke
pub fn spawn(self) -> ProcessWorkPoke
Spawn the loop on the current tokio runtime, returning the poke handle.
The loop drives once at startup (folding in the former startup-only recovery sweep), then on every poke and every poll tick until the process exits. Each drive is idempotent, so a poke racing a poll never double-runs a process.