Function ractor::time::send_interval
source · pub fn send_interval<TMessage, F>(
period: Duration,
actor: ActorCell,
msg: F
) -> JoinHandle<()>
Expand description
Sends a message to a given actor repeatedly after a specified time using the provided message generation function. The task will exit once the channel is closed (meaning the underlying crate::Actor has terminated)
period
- The Duration representing the period for the send intervalactor
- The ActorCell representing the crate::Actor to communicate withmsg
- The Fn message builder which is called to generate a message for each send operation.
Returns: The JoinHandle which represents the backgrounded work (can be ignored to “fire and forget”)