ConsumerService

Trait ConsumerService 

Source
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§

Source

type ReceiveMessagesStream: Stream<Item = Result<StreamMessage, Status>> + Send + 'static

Server streaming response type for the ReceiveMessages method.

Required Methods§

Source

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

Source

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

Source

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,

Acknowledges receipt of a message from the Consumer

Implementors§