Skip to main content

multi_call

Function multi_call 

Source
pub async fn multi_call<TMessage, TReply, TMsgBuilder>(
    actors: &[ActorRef<TMessage>],
    msg_builder: TMsgBuilder,
    timeout_option: Option<Duration>,
) -> Result<Vec<CallResult<TReply>>, MessagingErr<TMessage>>
where TMessage: Message, TReply: Send + 'static, TMsgBuilder: Fn(RpcReplyPort<TReply>) -> TMessage,
Expand description

Sends an asynchronous request to the specified actors, building a one-time use reply channel for each actor and awaiting the results with the specified timeout

  • actors - A reference to the group of ActorCells to communicate with
  • msg_builder - The FnOnce to construct the message
  • timeout_option - An optional Duration which represents the amount of time until the operation times out

Returns [Ok(Vec<CallResult<TReply>>>)] upon successful initial sending with the reply from the crate::Actors, [Err(MessagingErr)] if the initial send operation failed