Function ractor::rpc::call

source ·
pub async fn call<TMessage, TReply, TMsgBuilder>(
    actor: &ActorCell,
    msg_builder: TMsgBuilder,
    timeout_option: Option<Duration>
) -> Result<CallResult<TReply>, MessagingErr<TMessage>>
where TMessage: Message, TMsgBuilder: FnOnce(RpcReplyPort<TReply>) -> TMessage,
Expand description

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

  • actor - A reference to the ActorCell 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(CallResult)] upon successful initial sending with the reply from the crate::Actor, [Err(MessagingErr)] if the initial send operation failed