[][src]Struct dager::executor::Executor

pub struct Executor { /* fields omitted */ }

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.