Skip to main content

send_message_on

Function send_message_on 

Source
pub fn send_message_on<A, M, F>(ctx: Context<A>, f: F, msg: M) -> JoinHandle<()>
where A: Actor + Handler<M>, M: Message, F: FnOnce() + Send + 'static,
Expand description

Send a message to an actor when a blocking closure completes.

Spawns a thread that runs f(), then sends msg to the actor. If the actor stops before f() returns, the message is not sent.