wait_for_persistence

Function wait_for_persistence 

Source
async fn wait_for_persistence(
    stream: &mut SubscriptionStream<BlockNumHash>,
    target: u64,
    last_persisted: &mut u64,
    timeout: Duration,
) -> Result<()>
Expand description

Waits until the persistence subscription reports that target has been persisted.

Consumes subscription events until last_persisted >= target, or returns an error if:

  • the subscription stream ends unexpectedly, or
  • timeout elapses before target is observed.