pub trait ConsumerService:
Send
+ Sync
+ 'static {
type ReceiveMessagesStream: Stream<Item = Result<StreamMessage, Status>> + Send + 'static;
// Required methods
fn subscribe<'life0, 'async_trait>(
&'life0 self,
request: Request<ConsumerRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<ConsumerResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn receive_messages<'life0, 'async_trait>(
&'life0 self,
request: Request<ReceiveRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::ReceiveMessagesStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn ack<'life0, 'async_trait>(
&'life0 self,
request: Request<AckRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<AckResponse>, 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 ConsumerServiceServer.
Required Associated Types§
Sourcetype ReceiveMessagesStream: Stream<Item = Result<StreamMessage, Status>> + Send + 'static
type ReceiveMessagesStream: Stream<Item = Result<StreamMessage, Status>> + Send + 'static
Server streaming response type for the ReceiveMessages method.
Required Methods§
Sourcefn subscribe<'life0, 'async_trait>(
&'life0 self,
request: Request<ConsumerRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<ConsumerResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe<'life0, 'async_trait>(
&'life0 self,
request: Request<ConsumerRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<ConsumerResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Creates a new Subscriber
Sourcefn receive_messages<'life0, 'async_trait>(
&'life0 self,
request: Request<ReceiveRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::ReceiveMessagesStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn receive_messages<'life0, 'async_trait>(
&'life0 self,
request: Request<ReceiveRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::ReceiveMessagesStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Streaming messages to the Subscriber