pub struct Queue { /* private fields */ }Expand description
The MVSync queue. A single queue exists per MVSync instance. It is ran on its own thread, and distributes tasks efficiently between threads that are allocated to MVSync.
If a task that is submitted is waiting on a semaphore, it will not be submitted until it is ready, to prevent the workers from being clogged by functions that are waiting for other functions.
Implementations§
Source§impl Queue
impl Queue
Sourcepub fn submit(&self, task: Task)
pub fn submit(&self, task: Task)
Submit a task to the queue. This will push the task to the back of the queue. When there is a free worker available, the task will be popped off the queue and executed by the worker.
§Arguments
task - The task to push to the back of the queue.
Sourcepub fn submit_all(&self, tasks: Vec<Task>)
pub fn submit_all(&self, tasks: Vec<Task>)
Submit a vec of tasks to the queue. This will push the task to the back of the queue. When there is a free worker available, the task will be popped off the queue and executed by the worker in order.
§Arguments
tasks - The vec of tasks to push to the back of the queue.
Sourcepub fn submit_on(&self, task: Task, thread: &str)
pub fn submit_on(&self, task: Task, thread: &str)
Submit a task to the queue. This will push the task to the back of the queue. When there is a free worker available on the given thread, the task will be popped off the queue and executed by the worker.
§Arguments
task - The task to push to the back of the queue.
Sourcepub fn submit_all_on(&self, tasks: Vec<Task>, thread: &str)
pub fn submit_all_on(&self, tasks: Vec<Task>, thread: &str)
Submit a vec of tasks to the queue. This will push the task to the back of the queue. When there is a free worker available on the given thread, the task will be popped off the queue and executed by the worker in order.
§Arguments
tasks - The vec of tasks to push to the back of the queue.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Queue
impl RefUnwindSafe for Queue
impl Send for Queue
impl Sync for Queue
impl Unpin for Queue
impl UnwindSafe for Queue
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
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T, U> UnsafeInto<U> for Twhere
U: UnsafeFrom<T>,
impl<T, U> UnsafeInto<U> for Twhere
U: UnsafeFrom<T>,
Source§unsafe fn into(self) -> U
unsafe fn into(self) -> U
Calls U::from(self).
That is, this conversion is whatever the implementation of
UnsafeFrom<T> for U chooses to do.