[−][src]Struct bastion_executor::run_queue::Injector
An injector queue.
This is a FIFO queue that can be shared among multiple threads. Task schedulers typically have a single injector queue, which is the entry point for new tasks.
Methods
impl<T> Injector<T>
[src]
pub fn new() -> Injector<T>
[src]
Creates a new injector queue.
pub fn push(&self, task: T)
[src]
Pushes a task into the queue.
pub fn steal(&self) -> Steal<T>
[src]
Steals a task from the queue.
pub fn steal_batch(&self, dest: &Worker<T>) -> Steal<()>
[src]
Steals a batch of tasks and pushes them into a worker.
How many tasks exactly will be stolen is not specified. That said, this method will try to steal around half of the tasks in the queue, but also not more than some constant limit.
pub fn steal_batch_and_pop(&self, dest: &Worker<T>) -> Steal<T>
[src]
Steals a batch of tasks, pushes them into a worker, and pops a task from that worker.
How many tasks exactly will be stolen is not specified. That said, this method will try to steal around half of the tasks in the queue, but also not more than some constant limit.
pub fn is_empty(&self) -> bool
[src]
Returns true
if the queue is empty.
Trait Implementations
impl<T: Send> Send for Injector<T>
[src]
impl<T: Send> Sync for Injector<T>
[src]
impl<T> Drop for Injector<T>
[src]
impl<T> Debug for Injector<T>
[src]
Auto Trait Implementations
impl<T> Unpin for Injector<T> where
T: Unpin,
T: Unpin,
impl<T> !UnwindSafe for Injector<T>
impl<T> RefUnwindSafe for Injector<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,