RestartSource.onFailuresWithBackoff
Wrap the given Source
with a Source
that will restart it when it fails using an exponential backoff.
Signature
def onFailuresWithBackoff[T](minBackoff: FiniteDuration, maxBackoff: FiniteDuration, randomFactor: Double)(sourceFactory: () => Source[T, _]): Source[T, NotUsed]
def onFailuresWithBackoff[T](minBackoff: FiniteDuration,maxBackoff: FiniteDuration,randomFactor: Double,maxRestarts: Int)(sourceFactory: () => Source[T, _]): Source[T, NotUsed]
Description
This Source
will never emit a failure, since the failure of the wrapped Source
is always handled by restarting. The wrapped Source
can be cancelled by cancelling this Source
. When that happens, the wrapped Source
, if currently running will be cancelled, and it will not be restarted. This can be triggered simply by the downstream cancelling, or externally by introducing a KillSwitch
right after this Source
in the graph.
Reactive Streams semantics
emits when the wrapped source emits