pub struct Stash<'a, M, P>where
M: Send,
P: PartialOrd + Ord,{ /* private fields */ }
Expand description
For contention free queue insertion every thread maintains a private ‘stash’. When messages are send to the PriorityQueue while it is locked they are stored in this stash. Once the lock is obtained the stashed messages will be moved to the PriorityQueue. This can also be enforced with the ‘PriorityQueue::sync()’ function.
Implementations§
source§impl<'a, M, P> Stash<'a, M, P>where
M: Send,
P: PartialOrd + Ord,
impl<'a, M, P> Stash<'a, M, P>where
M: Send,
P: PartialOrd + Ord,
sourcepub fn new(pq: &'a PriorityQueue<M, P>) -> Self
pub fn new(pq: &'a PriorityQueue<M, P>) -> Self
Creates a new stash. A stash is tied to a priority queue, when the stash becomes dropped all its remaining temporary messages will be sent to the queue.
sourcepub fn without_priority_queue() -> Self
pub fn without_priority_queue() -> Self
Creates a new stash. This Stash has no reference to a priority queue, messages left here at drop time become discarded.