Struct sorceress::scheduler::Scheduler[][src]

pub struct Scheduler(_);

An ahead-of-time scheduler for executing recurring tasks.

Implementations

impl Scheduler[src]

pub fn new() -> Scheduler[src]

Create a new scheduler

pub fn ahead_by(self, ahead_by: Duration) -> Self[src]

Schedule the job in advance.

OSC messages sent to the SuperCollider server can have timestamps attached to them which lets SuperCollider execute the messages at a precise time. In this scenario the messages must be sent to the server before they need to be executed.

This function pushes the logical_time parameter passed to JobDef::init and Job::run into the future so that the OSC messages have time to be sent to the server and processed before they need to be scheduled.

Defaults to 100 milliseconds.

pub fn handle(&self) -> Handle[src]

Returns a Handle which can be used to stop a Scheduler from another thread.

The Scheduler::run method will return immediately after Handle::cancel is called on the handle returned by this method.

pub fn run(self, job_def: impl JobDef) -> Result<()>[src]

Creates the job and runs it until it returns None.

This function will block until the job has finished running. See Scheduler::handle for a way to interrupt this method from a different thread.

Trait Implementations

impl Debug for Scheduler[src]

impl Default for Scheduler[src]

Auto Trait Implementations

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.