Skip to main content

SubscriptionFactory

Trait SubscriptionFactory 

pub trait SubscriptionFactory: MaybeSend + MaybeSync {
    // Required method
    fn open(
        &self,
        cursors: HashMap<Topic, Cursor>,
        limits: IncomingBatchLimits,
    ) -> Pin<Box<dyn Future<Output = Result<IncomingSubscription<NetworkError>, NetworkError>> + Send>>;

    // Provided methods
    fn bind_limits(
        &self,
        _limits: &LimitsConfiguration,
    ) -> Option<Arc<dyn SubscriptionFactory>> { ... }
    fn is_suspended(&self) -> bool { ... }
}
Expand description

Opens one client’s incoming subscriptions over its API client.

Required Methods§

fn open( &self, cursors: HashMap<Topic, Cursor>, limits: IncomingBatchLimits, ) -> Pin<Box<dyn Future<Output = Result<IncomingSubscription<NetworkError>, NetworkError>> + Send>>

Subscribe to cursors, delivering batches within limits.

Provided Methods§

fn bind_limits( &self, _limits: &LimitsConfiguration, ) -> Option<Arc<dyn SubscriptionFactory>>

Bind a fresh factory to one client’s admitted snapshot when it needs it.

fn is_suspended(&self) -> bool

A suspended live receiver must not start automatic unary network work.

Implementors§

§

impl<A> SubscriptionFactory for BidiSubscriptionFactory<A>

Available on not (target_family=wasm and target_os=unknown).
§

impl<F> SubscriptionFactory for F
where F: Fn(HashMap<Topic, Cursor>, IncomingBatchLimits) -> Pin<Box<dyn Future<Output = Result<IncomingSubscription<NetworkError>, NetworkError>> + Send>> + MaybeSend + MaybeSync,