pub struct CompletionRegistry { /* private fields */ }Expand description
Registry of pending completion waiters, keyed by InputId.
Uses Vec<Sender> per InputId to support multiple waiters for the same input
(e.g. dedup of in-flight input registers a second waiter for the same InputId).
Implementations§
Source§impl CompletionRegistry
impl CompletionRegistry
pub fn new() -> Self
Sourcepub fn register(&mut self, input_id: InputId) -> CompletionHandle
pub fn register(&mut self, input_id: InputId) -> CompletionHandle
Register a waiter for an input. Returns the handle the caller will await.
Multiple waiters can be registered for the same InputId — all will be resolved when the input reaches a terminal state.
Sourcepub fn resolve_completed(
&mut self,
input_id: &InputId,
result: RunResult,
) -> bool
pub fn resolve_completed( &mut self, input_id: &InputId, result: RunResult, ) -> bool
Resolve all waiters for a completed input.
Returns true if any waiters were found and resolved.
Sourcepub fn resolve_without_result(&mut self, input_id: &InputId) -> bool
pub fn resolve_without_result(&mut self, input_id: &InputId) -> bool
Resolve all waiters for an input that completed without producing a RunResult.
Returns true if any waiters were found and resolved.
Sourcepub fn resolve_abandoned(&mut self, input_id: &InputId, reason: String) -> bool
pub fn resolve_abandoned(&mut self, input_id: &InputId, reason: String) -> bool
Resolve all waiters for an abandoned input.
Returns true if any waiters were found and resolved.
Sourcepub fn resolve_all_terminated(&mut self, reason: &str)
pub fn resolve_all_terminated(&mut self, reason: &str)
Resolve all pending waiters with a termination error.
Used when the runtime is stopped or destroyed.
Sourcepub fn has_pending(&self) -> bool
pub fn has_pending(&self) -> bool
Check if there are any pending waiters.
Sourcepub fn pending_count(&self) -> usize
pub fn pending_count(&self) -> usize
Number of pending waiters (total across all InputIds).