Skip to main content

SubscriptionService

Trait SubscriptionService 

Source
pub trait SubscriptionService:
    Send
    + Sync
    + 'static {
    type SubscribeStream: Stream<Item = Result<SubscribeResponse, Status>> + Send + 'static;
    type SubscribeStaticStream: Stream<Item = Result<SubscribeStaticResponse, Status>> + Send + 'static;

    // Required methods
    fn subscribe<'life0, 'async_trait>(
        &'life0 self,
        request: Request<Streaming<SubscribeRequest>>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::SubscribeStream>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn subscribe_static<'life0, 'async_trait>(
        &'life0 self,
        request: Request<SubscribeStaticRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::SubscribeStaticStream>, 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 SubscriptionServiceServer.

Required Associated Types§

Source

type SubscribeStream: Stream<Item = Result<SubscribeResponse, Status>> + Send + 'static

Server streaming response type for the Subscribe method.

Source

type SubscribeStaticStream: Stream<Item = Result<SubscribeStaticResponse, Status>> + Send + 'static

Server streaming response type for the SubscribeStatic method.

Required Methods§

Source

fn subscribe<'life0, 'async_trait>( &'life0 self, request: Request<Streaming<SubscribeRequest>>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::SubscribeStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

One client’s ordered topic feeds, with atomic interest updates.

Source

fn subscribe_static<'life0, 'async_trait>( &'life0 self, request: Request<SubscribeStaticRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::SubscribeStaticStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Server-streaming stream over a fixed topic list, for gRPC-Web clients.

Implementors§