pub trait CommandHandlerService:
Send
+ Sync
+ 'static {
// Required methods
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 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;
}Expand description
Generated trait containing gRPC methods that should be implemented for use with CommandHandlerServiceServer.
Required Methods§
Sourcefn 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)
Sourcefn 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