Skip to main content

resubscribe

Function resubscribe 

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

Re-creates the message stream once the connection is back, retrying failed attempts with exponential backoff.

Returns None when the receiver was dropped while waiting or retrying: with nobody left to receive the messages, the background task should stop.