Struct sorceress::scheduler::Scheduler [−][src]
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
Auto Trait Implementations
impl !RefUnwindSafe for Scheduler
impl Send for Scheduler
impl !Sync for Scheduler
impl Unpin for Scheduler
impl !UnwindSafe for Scheduler
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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.
pub 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>,