pub enum PriorityQueueType {
BinaryHeap,
HandleBased,
}Expand description
Specifies the underlying priority queue implementation used by the scheduler.
Choosing the right type affects dependency count and scheduler capabilities, particularly around job cancellation and updates.
Variants§
BinaryHeap
Uses std::collections::BinaryHeap.
- Dependencies: Standard library only.
- Cancellation: Job cancellation checks happen lazily when a job instance reaches the front of the queue.
- Updates: Efficient updates of already scheduled job times are not supported.
- Recommendation: Suitable for basic scheduling needs where proactive cancellation or job updates are not required, and minimizing dependencies is preferred.
HandleBased
Uses the priority-queue crate, providing handles to queued items.
- Dependencies: Adds the
priority-queuecrate. - Cancellation: Supports efficient O(log n) proactive removal of cancelled job
instances directly from the queue via
TurnKeeper::cancel_job. - Updates: Enables potential future features or direct support for efficiently
updating the
next_runtime of an already scheduled job instance. - Recommendation: Suitable if more responsive cancellation (proactive removal) or the ability to update scheduled job times is desired.
Trait Implementations§
Source§impl Clone for PriorityQueueType
impl Clone for PriorityQueueType
Source§fn clone(&self) -> PriorityQueueType
fn clone(&self) -> PriorityQueueType
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PriorityQueueType
impl Debug for PriorityQueueType
Source§impl PartialEq for PriorityQueueType
impl PartialEq for PriorityQueueType
impl Copy for PriorityQueueType
impl Eq for PriorityQueueType
impl StructuralPartialEq for PriorityQueueType
Auto Trait Implementations§
impl Freeze for PriorityQueueType
impl RefUnwindSafe for PriorityQueueType
impl Send for PriorityQueueType
impl Sync for PriorityQueueType
impl Unpin for PriorityQueueType
impl UnwindSafe for PriorityQueueType
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.