pub fn resubscribing_stream<T, F, Fut>(
signals: Arc<ConnectionSignals>,
channel_size: usize,
subject: &'static str,
initial: Pin<Box<dyn Stream<Item = T> + Send>>,
make_stream: F,
) -> impl Stream<Item = T> + Send + 'staticExpand description
Spawns the background re-subscribe/forward task for a durable consumer and returns the consumer-facing stream.
initial is the already-created message stream (so setup errors surface
synchronously at the call site); make_stream re-creates it after each
disconnect. Items are forwarded through an internal channel holding
channel_size items, and the task re-subscribes with exponential backoff
until the receiver is dropped.
Shared by Subscriber::subscribe
and Responder::respond, which
differ only in the per-message stream make_stream produces.