[][src]Trait sealrs::actors::timers::AbstractTimers

pub trait AbstractTimers {
    fn start_single(
        &mut self,
        key: u32,
        self_: &ActorRef,
        to: &ActorRef,
        delay: Duration,
        msg: Message
    );
fn start_periodic(
        &mut self,
        key: u32,
        self_: &ActorRef,
        to: &ActorRef,
        interval: Duration,
        msg: Box<dyn Fn() -> Message + Send + 'static>
    );
fn cancel(&mut self, key: u32);
fn cancel_all(&mut self); }

Required methods

fn start_single(
    &mut self,
    key: u32,
    self_: &ActorRef,
    to: &ActorRef,
    delay: Duration,
    msg: Message
)

fn start_periodic(
    &mut self,
    key: u32,
    self_: &ActorRef,
    to: &ActorRef,
    interval: Duration,
    msg: Box<dyn Fn() -> Message + Send + 'static>
)

fn cancel(&mut self, key: u32)

fn cancel_all(&mut self)

Loading content...

Implementors

impl AbstractTimers for RealTimers[src]

fn start_single(
    &mut self,
    key: u32,
    self_: &ActorRef,
    to: &ActorRef,
    delay: Duration,
    msg: Message
)
[src]

Starts single timer task. Accept as args - key, refs to self and receiver of message, delay and message for send. For example see module level doc or example actor in the examples module.

fn start_periodic(
    &mut self,
    key: u32,
    self_: &ActorRef,
    to: &ActorRef,
    interval: Duration,
    msg: Box<dyn Fn() -> Message + Send + 'static>
)
[src]

Starts single timer task. Accept as args - key, refs to self and receiver of message, delay and closure which produce a message for send. For example see the module level doc or example actor in the examples module.

fn cancel(&mut self, key: u32)[src]

Cancel timer by it's key

fn cancel_all(&mut self)[src]

Cancels all timers

impl AbstractTimers for StubTimers[src]

Loading content...