pub trait XmtpMlsBidiStreams: MaybeSend + MaybeSync {
type SubscribeStream: Stream<Item = Result<SubscribeResponse, Self::Error>> + MaybeSend;
type Error: RetryableError + 'static;
// Required method
fn subscribe_bidi<'life0, 'async_trait>(
&'life0 self,
requests: BoxStream<'static, SubscribeRequest>,
) -> Pin<Box<dyn Future<Output = Result<Self::SubscribeStream, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
The XIP-83 bidirectional subscription: one long-lived stream carrying
group and welcome messages, mutated in place (no reconnect on membership
change) and kept alive with WebSocket-style ping/pong. Native-only —
gRPC-Web transports cannot speak full-duplex, so browsers stay on
XmtpMlsStreams with a client-side watchdog.
Required Associated Types§
type SubscribeStream: Stream<Item = Result<SubscribeResponse, Self::Error>> + MaybeSend
type Error: RetryableError + 'static
Required Methods§
Sourcefn subscribe_bidi<'life0, 'async_trait>(
&'life0 self,
requests: BoxStream<'static, SubscribeRequest>,
) -> Pin<Box<dyn Future<Output = Result<Self::SubscribeStream, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe_bidi<'life0, 'async_trait>(
&'life0 self,
requests: BoxStream<'static, SubscribeRequest>,
) -> Pin<Box<dyn Future<Output = Result<Self::SubscribeStream, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Open the bidirectional stream. requests is the outbound
client→server frame stream (typically fed by a channel; the first
frame is usually a Mutate naming the initial topic set); the
returned stream yields the server→client frames.