sui_rpc_api::proto::rpc::v2alpha::subscription_service_server

Trait SubscriptionService

Source
pub trait SubscriptionService:
    Send
    + Sync
    + 'static {
    type SubscribeCheckpointsStream: Stream<Item = Result<SubscribeCheckpointsResponse, Status>> + Send + 'static;

    // Required method
    fn subscribe_checkpoints<'life0, 'async_trait>(
        &'life0 self,
        request: Request<SubscribeCheckpointsRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::SubscribeCheckpointsStream>, 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 SubscribeCheckpointsStream: Stream<Item = Result<SubscribeCheckpointsResponse, Status>> + Send + 'static

Server streaming response type for the SubscribeCheckpoints method.

Required Methods§

Source

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

Subscribe to the stream of checkpoints.

This API provides a subscription to the checkpoint stream for the Sui blockchain. When a subscription is initialized the stream will begin with the latest executed checkpoint as seen by the server. Responses are gaurenteed to return checkpoints in-order and without gaps. This enables clients to know exactly the last checkpoint they have processed and in the event the subscription terminates (either by the client/server or by the connection breaking), clients will be able to reinitailize a subscription and then leverage other APIs in order to request data for the checkpoints they missed.

Implementors§