RemotingClient

Trait RemotingClient 

Source
pub trait RemotingClient: RemotingService {
    // Required methods
    async fn update_name_server_address_list(&self, addrs: Vec<CheetahString>);
    fn get_name_server_address_list(&self) -> &[CheetahString];
    fn get_available_name_srv_list(&self) -> Vec<CheetahString>;
    async fn invoke_request(
        &self,
        addr: Option<&CheetahString>,
        request: RemotingCommand,
        timeout_millis: u64,
    ) -> RocketMQResult<RemotingCommand>;
    async fn invoke_request_oneway(
        &self,
        addr: &CheetahString,
        request: RemotingCommand,
        timeout_millis: u64,
    );
    fn is_address_reachable(&mut self, addr: &CheetahString);
    fn close_clients(&mut self, addrs: Vec<String>);
    fn register_processor(&mut self, processor: impl RequestProcessor + Sync);
}
Expand description

RemotingClient trait extends RemotingService to provide client-specific remote interaction functionalities.

This trait defines methods for managing name remoting_server addresses, invoking commands asynchronously or without expecting a response, checking if an address is reachable, and closing clients connected to specific addresses.

Required Methods§

Source

async fn update_name_server_address_list(&self, addrs: Vec<CheetahString>)

Updates the list of name remoting_server addresses.

§Arguments
  • addrs - A list of name remoting_server addresses to update.
Source

fn get_name_server_address_list(&self) -> &[CheetahString]

Retrieves the current list of name remoting_server addresses.

§Returns

A vector containing the current list of name remoting_server addresses.

Source

fn get_available_name_srv_list(&self) -> Vec<CheetahString>

Retrieves a list of available name remoting_server addresses.

§Returns

A vector containing the list of available name remoting_server addresses.

Source

async fn invoke_request( &self, addr: Option<&CheetahString>, request: RemotingCommand, timeout_millis: u64, ) -> RocketMQResult<RemotingCommand>

Asynchronously invokes a command on a specified address.

§Arguments
  • addr - The address to invoke the command on.
  • request - The RemotingCommand to be sent.
  • timeout_millis - The timeout for the operation in milliseconds.
§Returns

A Result containing either the response RemotingCommand or an Error.

Source

async fn invoke_request_oneway( &self, addr: &CheetahString, request: RemotingCommand, timeout_millis: u64, )

Invokes a command on a specified address without waiting for a response.

§Arguments
  • addr - The address to invoke the command on.
  • request - The RemotingCommand to be sent.
  • timeout_millis - The timeout for the operation in milliseconds.
Source

fn is_address_reachable(&mut self, addr: &CheetahString)

Checks if a specified address is reachable.

§Arguments
  • addr - The address to check for reachability.
Source

fn close_clients(&mut self, addrs: Vec<String>)

Closes clients connected to the specified addresses.

§Arguments
  • addrs - A list of addresses whose clients should be closed.
Source

fn register_processor(&mut self, processor: impl RequestProcessor + Sync)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§