pub struct PendingQueue { /* private fields */ }Expand description
The queue itself. Inner.queue holds the registry; Inner.cv is
the wake signal for parked vs_prompt_input calls. Wrapped in
Arc<Mutex> so multiple daemon threads can share it.
Implementations§
Source§impl PendingQueue
impl PendingQueue
pub fn new() -> Arc<Self>
Sourcepub fn enqueue_and_wait(
&self,
entry: PendingEntry,
timeout: Duration,
) -> Option<String>
pub fn enqueue_and_wait( &self, entry: PendingEntry, timeout: Duration, ) -> Option<String>
Enqueue a pending entry and block on the condvar until it is
fulfilled, cancelled, or timeout elapses. Returns the value
on fulfillment, None on cancellation or timeout.
Sourcepub fn list(&self) -> Vec<PendingEntry>
pub fn list(&self) -> Vec<PendingEntry>
Snapshot of all pending entries (id + user-visible metadata).
Sourcepub fn fulfill(&self, id: &str, value: String) -> bool
pub fn fulfill(&self, id: &str, value: String) -> bool
Fulfill a pending entry with value. Wakes parked waiters.
Sourcepub fn peek(&self, id: &str) -> Option<PendingEntry>
pub fn peek(&self, id: &str) -> Option<PendingEntry>
Peek a pending entry (no removal).
Trait Implementations§
Source§impl Default for PendingQueue
impl Default for PendingQueue
Source§fn default() -> PendingQueue
fn default() -> PendingQueue
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for PendingQueue
impl RefUnwindSafe for PendingQueue
impl Send for PendingQueue
impl Sync for PendingQueue
impl Unpin for PendingQueue
impl UnsafeUnpin for PendingQueue
impl UnwindSafe for PendingQueue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more