pub struct DispatchQueue<'a> {
pub(super) conn: &'a Mutex<Connection>,
}Fields§
§conn: &'a Mutex<Connection>Implementations§
Source§impl<'a> DispatchQueue<'a>
impl<'a> DispatchQueue<'a>
Sourcepub fn upsert(&self, q: &QueuedDispatch) -> Result<()>
pub fn upsert(&self, q: &QueuedDispatch) -> Result<()>
Upsert a pending Dispatch for (hostname, rollout_id). Idempotent:
re-emission of QueueDispatch for the same pair overwrites
target_closure / soak_due_at (the reducer’s view always wins).
Sourcepub fn take_for_host(&self, hostname: &str) -> Result<Option<QueuedDispatch>>
pub fn take_for_host(&self, hostname: &str) -> Result<Option<QueuedDispatch>>
Atomically claim and delete the next queued Dispatch for hostname.
Returns Ok(None) if no dispatch is pending.
Atomicity: SELECT + DELETE in one txn under the connection mutex. SQLite’s WAL mode + the single-writer Mutex make this race-free even with multiple long-poll handlers (no two see the same row).
Sourcepub fn peek_for_host(&self, hostname: &str) -> Result<bool>
pub fn peek_for_host(&self, hostname: &str) -> Result<bool>
Peek without claiming. Used by the long-poll worker after a wake
event to decide whether to actually fire take_for_host (avoids a
txn on every wake when the queue is empty for this host).
Auto Trait Implementations§
impl<'a> Freeze for DispatchQueue<'a>
impl<'a> RefUnwindSafe for DispatchQueue<'a>
impl<'a> Send for DispatchQueue<'a>
impl<'a> Sync for DispatchQueue<'a>
impl<'a> Unpin for DispatchQueue<'a>
impl<'a> UnwindSafe for DispatchQueue<'a>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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