Struct scheduled_executor::executor::CoreExecutor
[−]
[src]
pub struct CoreExecutor { /* fields omitted */ }
A CoreExecutor
is the most simple executor provided. It runs a single thread, which is
responsible for both scheduling the closure (registering the timer for the wakeup), and
the actual execution of the closure. The executor will stop once dropped. The CoreExecutor
can be cloned to generate a new reference to the same underlying executor.
Methods
impl CoreExecutor
[src]
fn new() -> Result<CoreExecutor, Error>
Creates a new CoreExecutor
.
fn with_name(thread_name: &str) -> Result<CoreExecutor, Error>
Creates a new CoreExecutor
with the specified thread name.
fn schedule_fixed_interval<F>(
&self,
initial: Duration,
interval: Duration,
scheduled_fn: F
) where
F: Fn(&Handle) + Send + 'static,
&self,
initial: Duration,
interval: Duration,
scheduled_fn: F
) where
F: Fn(&Handle) + Send + 'static,
Schedule a function for running at fixed intervals. The executor will try to run the
function every interval
, but if one execution takes longer than interval
it will delay
all the subsequent calls.
fn schedule_fixed_rate<F>(
&self,
initial: Duration,
interval: Duration,
scheduled_fn: F
) where
F: Fn(&Handle) + Send + 'static,
&self,
initial: Duration,
interval: Duration,
scheduled_fn: F
) where
F: Fn(&Handle) + Send + 'static,
Trait Implementations
impl Clone for CoreExecutor
[src]
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more