Module tonari_actor::timed

source ·
Expand description

Tools to make a given actor able to receive delayed and recurring messages.

To apply this to a given (receiving) actor:

The wrapped actor will accept TimedMessage<M> with convenience conversion from M. RecipientExt becomes available for Recipient<TimedMessage<M>>s which provides methods like send_delayed(), send_recurring().

Once accepted by the actor, delayed and recurring messages do not occupy place in actor’s channel inbox, they are placed to internal queue instead. Due to the design, delayed and recurring messages have always lower priority than instant messages when the actor is saturated.

See delay_actor.rs example for usage.

Structs

Enums

  • A message that can be delivered now, at certain time and optionally repeatedly.

Traits