![JAR search and dependency download from the Maven repository](/logo.png)
com.github.takezoe.retry.RetryPolicy.scala Maven / Gradle / Ivy
package com.github.takezoe.retry
import scala.concurrent.duration._
case class RetryPolicy(
maxAttempts: Int,
retryDuration: FiniteDuration,
backOff: BackOff = FixedBackOff,
jitter: FiniteDuration = 0.second,
onRetry: RetryContext => Unit = _ => (),
onFailure: RetryContext => Unit = _ => ()
)
case class RetryContext(
retryCount: Int,
exception: Throwable
)
object RetryPolicy {
val NoRetry = RetryPolicy(0, Duration.Zero, FixedBackOff)
def Immediately(attempts: Int): RetryPolicy = RetryPolicy(attempts, Duration.Zero, FixedBackOff)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy