Struct desync::scheduler::Scheduler

source ·
pub struct Scheduler { /* private fields */ }
Expand description

The scheduler is used to schedule tasks onto a pool of threads

Implementations

Creates a new scheduler

(There’s usually only one scheduler)

Changes the maximum number of threads this scheduler can spawn (existing threads are not despawned by this method)

Despawns threads if we’re running more than the maximum number

Must not be called from a scheduler thread (as it waits for the threads to despawn)

Spawns a thread in this scheduler

Creates a new job queue for this scheduler

👎Deprecated since 0.3.0: please use desync instead

Schedules a job on this scheduler, which will run after any jobs that are already in the specified queue and as soon as a thread is available to run it.

Schedules a job on this scheduler, which will run after any jobs that are already in the specified queue and as soon as a thread is available to run it.

Schedules a job to run and returns a future for retrieving the result

Pauses a queue until a particular future has completed, before performing a task with the result of that future

Requests that a queue be suspended once it has finished all of its active jobs

Resumes a queue that was previously suspended

Schedules a job on this scheduler, which will run after any jobs that are already in the specified queue. This function will not return until the job has completed.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.