pub struct Blocker<A> { /* private fields */ }
Expand description
block the actor (or make the actor waiting)
until some condition in block
is satisfied
Once a new Blocker
comes, it will block
the actor immediately and reject any incoming
messages.
Implementations§
source§impl<A: Actor> Blocker<A>
impl<A: Actor> Blocker<A>
sourcepub fn state(&self) -> BlockerState
pub fn state(&self) -> BlockerState
get the state
sourcepub fn set_state(&mut self, state: BlockerState)
pub fn set_state(&mut self, state: BlockerState)
set the state
sourcepub fn from_duration<T: Timing + 'static>(dur: Duration) -> Self
Available on crate feature time
only.
pub fn from_duration<T: Timing + 'static>(dur: Duration) -> Self
time
only.block the actor with specified duration
feature time
must be enabled
and the Timing implementation
is required with which the actor can know
the time