pub struct MultiExecutor {
shared: Arc<Shared>,
workers: Vec<JoinHandle<()>>,
}Expand description
A priority-aware executor running Send futures on worker threads.
Fields§
§workers: Vec<JoinHandle<()>>Implementations§
Source§impl MultiExecutor
impl MultiExecutor
Sourcepub fn with_fairness(workers: usize, every: u32) -> Self
pub fn with_fairness(workers: usize, every: u32) -> Self
workers threads; every every-th pick takes the longest-waiting ready task.
fn build(workers: usize, fairness: Option<u64>) -> Self
Sourcepub fn spawn(
&self,
priority: u16,
future: impl Future<Output = ()> + Send + 'static,
) -> MultiHandle
pub fn spawn( &self, priority: u16, future: impl Future<Output = ()> + Send + 'static, ) -> MultiHandle
Run future at priority (larger first).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MultiExecutor
impl !RefUnwindSafe for MultiExecutor
impl Send for MultiExecutor
impl Sync for MultiExecutor
impl Unpin for MultiExecutor
impl UnsafeUnpin for MultiExecutor
impl !UnwindSafe for MultiExecutor
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