pub struct WorkerExecutor { /* private fields */ }
Expand description
A worker queue allows for the submission of work to be done in parallel.
Implementations§
Source§impl WorkerExecutor
impl WorkerExecutor
pub fn new(pool_size: usize) -> Result<WorkerExecutor, Error>
Sourcepub fn join(self) -> Result<(), PayloadError<ProjectError>>
pub fn join(self) -> Result<(), PayloadError<ProjectError>>
Waits for all workers to finish. Unlike the drop implementation, Calls finish_jobs
.
Sourcepub fn submit<I>(&self, token: I) -> Result<WorkHandle<'_>, Error>
pub fn submit<I>(&self, token: I) -> Result<WorkHandle<'_>, Error>
Forces all running tokens to end. Submit some work to the Worker Queue.
pub fn any_panicked(&self) -> bool
Sourcepub fn finish_jobs(&mut self) -> Result<(), Error>
pub fn finish_jobs(&mut self) -> Result<(), Error>
Wait for all current jobs to finish.
Sourcepub fn queue(&self) -> WorkerQueue<'_>
pub fn queue(&self) -> WorkerQueue<'_>
Create a worker queue instance.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WorkerExecutor
impl !RefUnwindSafe for WorkerExecutor
impl Send for WorkerExecutor
impl Sync for WorkerExecutor
impl Unpin for WorkerExecutor
impl !UnwindSafe for WorkerExecutor
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> InstanceOf for T
impl<T> InstanceOf for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more