[−][src]Struct white_rabbit::Scheduler
This scheduler exists on two levels: The handle, granting you the ability of adding new tasks, and the executor, dating and executing these tasks when specified time is met.
Info: This scheduler may not be precise due to anomalies such as preemption or platform differences.
Methods
impl Scheduler
[src]
pub fn add_task_datetime<T>(&mut self, time: DateTime<Utc>, to_execute: T) where
T: FnMut(&mut Context) -> DateResult + Send + Sync + 'static,
[src]
T: FnMut(&mut Context) -> DateResult + Send + Sync + 'static,
Add a task to be executed when time
is reached.
pub fn add_task_duration<T>(&mut self, how_long: ChronoDuration, to_execute: T) where
T: FnMut(&mut Context) -> DateResult + Send + Sync + 'static,
[src]
T: FnMut(&mut Context) -> DateResult + Send + Sync + 'static,
impl Scheduler
[src]
pub fn new(thread_count: usize) -> Self
[src]
Creates a new Scheduler
which will use thread_count
number of
threads when tasks are being dispatched/dated.
Trait Implementations
impl<'a> Drop for Scheduler
[src]
Once the scheduler is dropped, we also need to join and finish the thread.
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,