pub async fn call_actor(
        &self,
        target_id: &str,
        operation: &str,
        data: &[u8],
    ) -> Result<InvocationResponse> {
        let subject = broker::rpc::call_actor(&self.nsprefix, target_id);
        let bytes = crate::generated::ctliface::serialize(Invocation::new(
            &self.key,
            Entity::Actor("system".to_string()),
            Entity::Actor(target_id.to_string()),
            operation,
            data.to_vec(),
        ))?;
        match actix_rt::time::timeout(self.timeout, self.nc.request(&subject, &bytes)).await? {
            Ok(msg) => {
                let resp: InvocationResponse = crate::generated::ctliface::deserialize(&msg.data)?;
                Ok(resp)
            }
            Err(e) => Err(format!("Actor RPC call did not succeed: {}", e).into()),
        }
    }
/// Performs a remote procedure call over the lattice, targeting the given actor. This call will appear
/// to originate from the "system" actor and from a unique host ID that was generated by the control
/// interface client when it was instantiated. If there are multiple actors with the same public key
/// actively running in the lattice, then the message broker is responsible for choosing the appropriate
/// target. Under current NATS implementations, that means an actor is chosen psuedo-randomly among the
/// known queue subscribers, and will **not** be invoked in round-robin fashion
Performs a remote procedure call over the lattice, targeting the given actor. This call will appear
to originate from the "system" actor and from a unique host ID that was generated by the control
interface client when it was instantiated. If there are multiple actors with the same public key
actively running in the lattice, then the message broker is responsible for choosing the appropriate
target. Under current NATS implementations, that means an actor is chosen psuedo-randomly among the
known queue subscribers, and will **not** be invoked in round-robin fashion
Performs a remote procedure call over the lattice targeting the given actor . This call will appear to originate from the " system " actor and from a unique host ID that was generated by the control interface client when it was instantiated . If there are multiple actors with the same public key actively running in the lattice then the message broker is responsible for choosing the appropriate target . Under current NATS implementations that means an actor is chosen psuedo - randomly among the known queue subscribers and will ** not ** be invoked in round - robin fashion
pub async fn call_actor(
        &self,
        target_id: &str,
        operation: &str,
        data: &[u8],
    ) -> Result<InvocationResponse> {
        let subject = broker::rpc::call_actor(&self.nsprefix, target_id);
        let bytes = crate::generated::ctliface::serialize(Invocation::new(
            &self.key,
            Entity::Actor("system".to_string()),
            Entity::Actor(target_id.to_string()),
            operation,
            data.to_vec(),
        ))?;
        match actix_rt::time::timeout(self.timeout, self.nc.request(&subject, &bytes)).await? {
            Ok(msg) => {
                let resp: InvocationResponse = crate::generated::ctliface::deserialize(&msg.data)?;
                Ok(resp)
            }
            Err(e) => Err(format!("Actor RPC call did not succeed: {}", e).into()),
        }
    }
pub async fn call_actor ( & self , target_id : & str , operation : & str , data : & [ u8 ] , ) -> Result < InvocationResponse > { let subject = broker :: rpc :: call_actor ( & self . nsprefix , target_id ) ; let bytes = crate :: generated :: ctliface :: serialize ( Invocation :: new ( & self . key , Entity :: Actor ( " " . to_string ( ) ) , Entity :: Actor ( target_id . to_string ( ) ) , operation , data . to_vec ( ) , ) ) ? ; match actix_rt :: time :: timeout ( self . timeout , self . nc . request ( & subject , & bytes ) ) . await ? { Ok ( msg ) => { let resp : InvocationResponse = crate :: generated :: ctliface :: deserialize ( & msg . data ) ? ; Ok ( resp ) } Err ( e ) => Err ( format ! ( " " e ) . into ( ) ) , } }
Performs a remote procedure call over the lattice, targeting the given actor.
Performs a remote procedure call over the lattice targeting the given actor .
&self
target_id
&str
operation
&str
data
&[u8]
&self
target_id
&str
operation
&str
data
&[u8]