Skip to main content

forward_and_resubscribe

Function forward_and_resubscribe 

Source
async fn forward_and_resubscribe<T, F, Fut>(
    signals: &ConnectionSignals,
    subject: &'static str,
    initial: Pin<Box<dyn Stream<Item = T> + Send>>,
    make_stream: F,
    tx: Sender<T>,
)
where T: Send + 'static, F: Fn() -> Fut + Sync, Fut: Future<Output = Result<Pin<Box<dyn Stream<Item = T> + Send>>, Error>>,
Expand description

Body of the background task behind resubscribing_stream: forwards initial into tx, then alternates between re-subscribing and forwarding until the receiver is dropped.