pub struct Delayer<A: Actor> { /* private fields */ }Expand description
send a delayed message with condition and get executed once the condition satisfied.
Implementations§
source§impl<A: Actor> Delayer<A>
impl<A: Actor> Delayer<A>
sourcepub fn state(&self) -> DelayerState
pub fn state(&self) -> DelayerState
get the state
sourcepub fn set_state(&mut self, state: DelayerState)
pub fn set_state(&mut self, state: DelayerState)
set the state
sourcepub fn from_duration<T: Timing + 'static>(
message: A::Message,
delay: Duration
) -> Self
Available on crate feature time only.
pub fn from_duration<T: Timing + 'static>( message: A::Message, delay: Duration ) -> Self
time only.deliver the message with specified delay duration
feature time must be enabled
and the Timing implementation
is required with which the actor can known
the time
NOTE that the delayed duration is NO LESS than
delay you specified, and is within minor deviation
sourcepub fn instant(message: A::Message) -> Self
pub fn instant(message: A::Message) -> Self
instantly deliver the message to its destination,
and it nearly takes no time
and it can be used as Messager
sourcepub unsafe fn repeat<T: Timing + 'static>(
message: A::Message,
duration: Option<Duration>,
repeats: Option<usize>
) -> Self
Available on crate feature time only.
pub unsafe fn repeat<T: Timing + 'static>( message: A::Message, duration: Option<Duration>, repeats: Option<usize> ) -> Self
time only.periodically deliver the message to its destination,
feature time must be enabled
and the Timing implementation
is required with which the actor can known
the time