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§
Sourceasync fn update_name_server_address_list(&self, addrs: Vec<CheetahString>)
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.
Sourcefn get_name_server_address_list(&self) -> &[CheetahString]
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.
Sourcefn get_available_name_srv_list(&self) -> Vec<CheetahString>
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.
Sourceasync fn invoke_request(
&self,
addr: Option<&CheetahString>,
request: RemotingCommand,
timeout_millis: u64,
) -> RocketMQResult<RemotingCommand>
async fn invoke_request( &self, addr: Option<&CheetahString>, request: RemotingCommand, timeout_millis: u64, ) -> RocketMQResult<RemotingCommand>
Sourceasync fn invoke_request_oneway(
&self,
addr: &CheetahString,
request: RemotingCommand,
timeout_millis: u64,
)
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- TheRemotingCommandto be sent.timeout_millis- The timeout for the operation in milliseconds.
Sourcefn is_address_reachable(&mut self, addr: &CheetahString)
fn is_address_reachable(&mut self, addr: &CheetahString)
Checks if a specified address is reachable.
§Arguments
addr- The address to check for reachability.
Sourcefn close_clients(&mut self, addrs: Vec<String>)
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.
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.