object RefreshableEffect
- Companion:
- class
- Source:
- RefreshableEffect.scala
Value members
Concrete methods
def createRetryResource[F[_] : Temporal, A](refresh: F[A], refreshInterval: FiniteDuration, onRefreshSuccess: F[Unit], onRefreshError: PartialFunction[Throwable, F[Unit]], retryDelay: FiniteDuration, retryNextDelay: FiniteDuration => FiniteDuration, retryMaxAttempts: Int, onRetriesExhausted: PartialFunction[Throwable, F[Unit]]): Resource[F, RefreshableEffect[F, A]]
Create a refreshable effect which exposes the result of refresh
, retries
if refreshing the value fails.
Create a refreshable effect which exposes the result of refresh
, retries
if refreshing the value fails.
- Value parameters:
- onRefreshError
what to do if refreshing the value fails, error is always rethrown
- onRefreshSuccess
what to do when the value is successfully refresh, errors are ignored
- onRetriesExhausted
what to do if retrying to refresh the value fails, up to user handle failing their service
- refreshInterval
how frequently to refresh the value
- retryDelay
duration of delay before the first retry
- retryMaxAttempts
how many attempts to make before failing with last error
- retryNextDelay
what value to delay before the next retry
- Source:
- RefreshableEffect.scala