[−][src]Struct dager::executor::Executor
Gets all the jobs an schedules them onto its inner threads. Is save to be cloned since it is only a managing reference to the threads.
When dropped, all executing jobs are finshed. However, jobs that are in line are not started. So this obj needs to be kept alive as long as you want to execute any jobs.
Implementations
impl Executor
[src]
pub fn new() -> Arc<Self>
[src]
pub fn new_with_threads(num_threads: usize) -> Arc<Self>
[src]
pub fn schedule(&self, new_task: Task) -> Result<(), ExecutorError>
[src]
Puts this task into the scheduler queue. The executor works via FIFO principle.
pub fn shutdown(&self)
[src]
Graceful shutdown of the executor, by waiting (and blocking) for all tasks to finish. If you don't need that, just drop the executor, which will kill all threads as fast as possible.
Auto Trait Implementations
impl !RefUnwindSafe for Executor
impl Send for Executor
impl Sync for Executor
impl Unpin for Executor
impl !UnwindSafe for Executor
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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.
pub 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>,