PureharmTimedAttemptReattemptSyntaxOps

Companion
class
class Object
trait Matchable
class Any

Value members

Concrete methods

def reattempt[F[_], A](errorLog: (Throwable, String) => F[Unit])(retries: Int, betweenRetries: FiniteDuration)(fa: F[A])(`evidence$4`: MonadThrow[F], `evidence$5`: Timer[F]): F[A]

Runs an effect F[A] a maximum of retries time, until it is not failed. Between each retry it waits betweenRetries. It also measures the time elapsed in total.

Runs an effect F[A] a maximum of retries time, until it is not failed. Between each retry it waits betweenRetries. It also measures the time elapsed in total.

Value Params
errorLog

Use this to specify how to log any error that happens within your fa, and any error encountered during retries N.B. you can also use FiniteDuration.toCoarsest to then obtain a more human friendly measurement as possible

Returns

N.B. It only captures the latest failure, if it encounters one.

def reattempt[F[_], A](retries: Int, betweenRetries: FiniteDuration)(fa: F[A])(`evidence$6`: MonadThrow[F], `evidence$7`: Timer[F]): F[A]

Same semantics as overload reattempt but does not report any error

Same semantics as overload reattempt but does not report any error

def timedAttempt[F[_], A](timeUnit: TimeUnit)(fa: F[A])(F: MonadThrow[F], timer: Timer[F]): F[(FiniteDuration, Attempt[A])]
Value Params
timeUnit

You probably don't want a granularity larger than MILLISECONDS for accurate timing. N.B. you can also use FiniteDuration.toCoarsest to then obtain a more human friendly measurement as possible

Returns

Never fails and captures the failure of the fa within the Attempt, times both success and failure case.

def timedReattempt[F[_], A](errorLog: (Throwable, String) => F[Unit], timeUnit: TimeUnit)(retries: Int, betweenRetries: FiniteDuration)(fa: F[A])(`evidence$2`: MonadThrow[F], `evidence$3`: Timer[F]): F[(FiniteDuration, Attempt[A])]

Runs an effect F[A] a maximum of retries time, until it is not failed. Between each retry it waits betweenRetries. It also measures the time elapsed in total.

Runs an effect F[A] a maximum of retries time, until it is not failed. Between each retry it waits betweenRetries. It also measures the time elapsed in total.

Value Params
errorLog

Use this to specify how to log any error that happens within your fa, and any error encountered during retries

timeUnit

You probably don't want a granularity larger than MILLISECONDS for accurate timing. N.B. you can also use FiniteDuration.toCoarsest to then obtain a more human friendly measurement as possible

Returns

Never fails and captures the failure of the fa within the Attempt, times all successes and failures, and returns their sum. N.B. It only captures the latest failure, if it encounters one.