pub struct TaskQueue { /* private fields */ }Expand description
A single FIFO task queue with enable/disable support.
Like Chrome’s base::sequence_manager::TaskQueue.
Each priority level in the scheduler owns one TaskQueue.
§Chrome features mapped
| Chrome | Kozan |
|---|---|
TaskQueue::SetQueueEnabled() | set_enabled() |
TaskQueue::InsertFence() | (future: set_fence() |
TaskQueue::GetNumberOfPending | len() |
PushBack / TakeTask | push() / pop() |
Implementations§
Source§impl TaskQueue
impl TaskQueue
Sourcepub fn new(priority: TaskPriority) -> Self
pub fn new(priority: TaskPriority) -> Self
Create a new empty queue for the given priority.
Sourcepub fn has_ready(&self) -> bool
pub fn has_ready(&self) -> bool
Whether this queue has tasks AND is enabled (actually pickable).
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Whether this queue is enabled.
Sourcepub fn set_enabled(&mut self, enabled: bool)
pub fn set_enabled(&mut self, enabled: bool)
Enable or disable this queue.
Disabled queues are skipped by TaskQueueManager::pick().
Chrome uses this to throttle background tab timers.
Sourcepub fn priority(&self) -> TaskPriority
pub fn priority(&self) -> TaskPriority
The priority level this queue serves.
Auto Trait Implementations§
impl Freeze for TaskQueue
impl !RefUnwindSafe for TaskQueue
impl !Send for TaskQueue
impl !Sync for TaskQueue
impl Unpin for TaskQueue
impl UnsafeUnpin for TaskQueue
impl !UnwindSafe for TaskQueue
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