pub struct CommandHandlerClient { /* private fields */ }Expand description
Default command handler coordinator client using tonic gRPC.
Implementations§
Source§impl CommandHandlerClient
impl CommandHandlerClient
Sourcepub async fn connect(endpoint: &str) -> Result<Self>
pub async fn connect(endpoint: &str) -> Result<Self>
Connect to a command handler coordinator at the given endpoint.
Supports both TCP (host:port) and Unix Domain Sockets (file paths).
Sourcepub async fn from_env(env_var: &str, default: &str) -> Result<Self>
pub async fn from_env(env_var: &str, default: &str) -> Result<Self>
Connect using an endpoint from environment variable with fallback.
Sourcepub fn from_channel(channel: Channel) -> Self
pub fn from_channel(channel: Channel) -> Self
Create a client from an existing channel.
Sourcepub async fn handle_command(
&self,
command: CommandRequest,
) -> Result<CommandResponse>
pub async fn handle_command( &self, command: CommandRequest, ) -> Result<CommandResponse>
Execute a command with specified sync mode.
Use SyncMode::Async for fire-and-forget (default).
Use SyncMode::Simple to wait for sync projectors.
Use SyncMode::Cascade for full sync including saga cascade.
Sourcepub async fn handle(&self, command: CommandBook) -> Result<CommandResponse>
pub async fn handle(&self, command: CommandBook) -> Result<CommandResponse>
Execute a command asynchronously (fire-and-forget).
Convenience method that wraps CommandBook in CommandRequest with async sync mode.
Sourcepub async fn handle_sync_speculative(
&self,
request: SpeculateCommandHandlerRequest,
) -> Result<CommandResponse>
pub async fn handle_sync_speculative( &self, request: SpeculateCommandHandlerRequest, ) -> Result<CommandResponse>
Speculative execution against temporal state.
Trait Implementations§
Source§impl Clone for CommandHandlerClient
impl Clone for CommandHandlerClient
Source§fn clone(&self) -> CommandHandlerClient
fn clone(&self) -> CommandHandlerClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl GatewayClient for CommandHandlerClient
impl GatewayClient for CommandHandlerClient
Source§fn execute<'life0, 'async_trait>(
&'life0 self,
command: CommandBook,
) -> Pin<Box<dyn Future<Output = Result<CommandResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
command: CommandBook,
) -> Pin<Box<dyn Future<Output = Result<CommandResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute a command asynchronously (fire and forget).
Auto Trait Implementations§
impl !Freeze for CommandHandlerClient
impl !RefUnwindSafe for CommandHandlerClient
impl Send for CommandHandlerClient
impl Sync for CommandHandlerClient
impl Unpin for CommandHandlerClient
impl UnsafeUnpin for CommandHandlerClient
impl !UnwindSafe for CommandHandlerClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> CommandBuilderExt for Twhere
T: GatewayClient,
impl<T> CommandBuilderExt for Twhere
T: GatewayClient,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request