pub struct CommandHandlerGrpc<S, H>where
S: Default + Send + Sync + 'static,
H: CommandHandlerDomainHandler<State = S> + Clone + 'static,{ /* private fields */ }Expand description
gRPC command handler service implementation.
Wraps a CommandHandlerRouter to handle commands.
Optionally supports Replay RPC for MERGE_COMMUTATIVE conflict detection.
Implementations§
Source§impl<S, H> CommandHandlerGrpc<S, H>where
S: Default + Send + Sync + 'static,
H: CommandHandlerDomainHandler<State = S> + Clone + 'static,
impl<S, H> CommandHandlerGrpc<S, H>where
S: Default + Send + Sync + 'static,
H: CommandHandlerDomainHandler<State = S> + Clone + 'static,
Sourcepub fn new(router: CommandHandlerRouter<S, H>) -> Self
pub fn new(router: CommandHandlerRouter<S, H>) -> Self
Create a new command handler from a router.
Sourcepub fn with_replay(self, packer: StatePacker<S>) -> Self
pub fn with_replay(self, packer: StatePacker<S>) -> Self
Enable Replay RPC support by providing a state packer.
Sourcepub fn router(&self) -> &CommandHandlerRouter<S, H>
pub fn router(&self) -> &CommandHandlerRouter<S, H>
Get the underlying router.
Trait Implementations§
Source§impl<S, H> CommandHandlerService for CommandHandlerGrpc<S, H>where
S: Default + Send + Sync + 'static,
H: CommandHandlerDomainHandler<State = S> + Clone + 'static,
impl<S, H> CommandHandlerService for CommandHandlerGrpc<S, H>where
S: Default + Send + Sync + 'static,
H: CommandHandlerDomainHandler<State = S> + Clone + 'static,
Source§fn handle<'life0, 'async_trait>(
&'life0 self,
request: Request<ContextualCommand>,
) -> Pin<Box<dyn Future<Output = Result<Response<BusinessResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle<'life0, 'async_trait>(
&'life0 self,
request: Request<ContextualCommand>,
) -> Pin<Box<dyn Future<Output = Result<Response<BusinessResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Process command and return business response (events or revocation request)
Source§fn replay<'life0, 'async_trait>(
&'life0 self,
request: Request<ReplayRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<ReplayResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn replay<'life0, 'async_trait>(
&'life0 self,
request: Request<ReplayRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<ReplayResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Replay events to compute state (for conflict detection)
Optional: only needed if aggregate supports MERGE_COMMUTATIVE
Auto Trait Implementations§
impl<S, H> Freeze for CommandHandlerGrpc<S, H>
impl<S, H> !RefUnwindSafe for CommandHandlerGrpc<S, H>
impl<S, H> Send for CommandHandlerGrpc<S, H>
impl<S, H> Sync for CommandHandlerGrpc<S, H>
impl<S, H> Unpin for CommandHandlerGrpc<S, H>
impl<S, H> UnsafeUnpin for CommandHandlerGrpc<S, H>
impl<S, H> !UnwindSafe for CommandHandlerGrpc<S, H>
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> 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