Struct jatsl::JobScheduler [−][src]
pub struct JobScheduler { /* fields omitted */ }
Expand description
Job and task lifecycle handler
Implementations
pub fn spawn_task<T, F: 'static + Send, O: 'static + Send, Context>(
task: &T,
ctx: Context
) -> JoinHandle<Result<O, Aborted>> where
F: Future<Output = O>,
T: Fn(TaskManager<Context>) -> F,
pub fn spawn_task<T, F: 'static + Send, O: 'static + Send, Context>(
task: &T,
ctx: Context
) -> JoinHandle<Result<O, Aborted>> where
F: Future<Output = O>,
T: Fn(TaskManager<Context>) -> F,
Run a new task with the given context on the default scheduler
This method makes the given future abortable and provides access to dependencies and terminates it if required dependencies become unavailable.
Assigns a new job to the scheduler.
This method respawns the job if it crashes, provides access to dependencies, keeps track of its lifecycle and restarts it if dependencies become unavailable.
Gracefully terminates a single job by name if supported, otherwise kill it with force.
Gracefully terminates all managed jobs that support it and kill all the others.
Wait until all currently registered jobs report their status as ready.
Most useful when running complex tests which require jobs to be running in the background. Checks the status every 100ms, so you probably should not use this in “production” code.
Trait Implementations
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl !RefUnwindSafe for JobScheduler
impl Send for JobScheduler
impl Sync for JobScheduler
impl Unpin for JobScheduler
impl !UnwindSafe for JobScheduler
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more