Trait tendermint_rpc::SubscriptionClient[][src]

pub trait SubscriptionClient {
    fn subscribe<'life0, 'async_trait>(
        &'life0 self,
        query: Query
    ) -> Pin<Box<dyn Future<Output = Result<Subscription, Error>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn unsubscribe<'life0, 'async_trait>(
        &'life0 self,
        query: Query
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn close(self) -> Result<(), Error>; }
Expand description

A client that exclusively provides Event subscription capabilities, without any other RPC method support.

Required methods

/subscribe: subscribe to receive events produced by the given query.

/unsubscribe: unsubscribe from events relating to the given query.

This method is particularly useful when you want to terminate multiple Subscriptions to the same Query simultaneously, or if you’ve joined multiple Subscriptions together using select_all and you no longer have access to the individual Subscription instances to terminate them separately.

Subscription clients will usually have long-running underlying transports that will need to be closed at some point.

Implementors