pub struct ProcessAwaiter { /* private fields */ }Expand description
Core waiter for process terminal state and events (ADR 0016).
The awaiter is the store-only fallback that
ProcessWorkDriver uses when no engine-native
ProcessAttach owns the wait. It performs narrow point reads
(get_process, events_after) and, when constructed with a
ProcessChangeHub, wakes promptly on local mutations instead of polling.
Callers still bound every wait with tokio::time::timeout.
Implementations§
Source§impl ProcessAwaiter
impl ProcessAwaiter
Sourcepub fn new(registry: Arc<dyn ProcessRegistry>, hub: ProcessChangeHub) -> Self
pub fn new(registry: Arc<dyn ProcessRegistry>, hub: ProcessChangeHub) -> Self
Hub-backed awaiter: local mutations published to hub wake waiters
without database polling. This is what a [WatchedProcessRegistry]
wrapping provides via watch_process_registry.
Sourcepub fn polling(registry: Arc<dyn ProcessRegistry>) -> Self
pub fn polling(registry: Arc<dyn ProcessRegistry>) -> Self
Hubless awaiter: correct without any change signal, using only the bounded backoff point-read loop (25ms floor, doubling, 1s cap). Use when the registry is not wrapped in-process — e.g. a store-only test.
Sourcepub async fn await_terminal(
&self,
process_id: &str,
) -> Result<ProcessAwaitOutput, PluginError>
pub async fn await_terminal( &self, process_id: &str, ) -> Result<ProcessAwaitOutput, PluginError>
Resolve once process_id is terminal, returning its outcome. See
ProcessWorkDriver::await_terminal
for the timeout-bounding contract.
Sourcepub async fn await_event(
&self,
process_id: &str,
event_type: &str,
after_sequence: u64,
) -> Result<ProcessEvent, PluginError>
pub async fn await_event( &self, process_id: &str, event_type: &str, after_sequence: u64, ) -> Result<ProcessEvent, PluginError>
Resolve with the first event_type event on process_id past
after_sequence. Historical matches resolve immediately.
Trait Implementations§
Source§impl Clone for ProcessAwaiter
impl Clone for ProcessAwaiter
Source§fn clone(&self) -> ProcessAwaiter
fn clone(&self) -> ProcessAwaiter
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more