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>>
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>>
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
fn is_suspended(&self) -> bool
A suspended live receiver must not start automatic unary network work.
Implementors§
impl<A> SubscriptionFactory for BidiSubscriptionFactory<A>where
A: XmtpMlsBidiStreams + ApiClientIdentity + Clone + Send + Sync + 'static,
<A as XmtpMlsBidiStreams>::SubscribeStream: 'static,
Available on not (
target_family=wasm and target_os=unknown).