mill.util.Retry
See theRetry companion object
case class Retry(count: Int, backoffMillis: Long, backoffMultiplier: Double, timeoutMillis: Long, filter: (Int, Throwable) => Boolean, logger: String => Unit)
Generic retry functionality
Value parameters
- backoffMillis
-
What is the initial backoff time
- backoffMultiplier
-
How much to multiply the initial backoff each time
- count
-
How many times to retry before giving up
- filter
-
Whether or not we want to retry a given exception at a given retryCount; defaults to
true
to retry all exceptions, but can be made more fine-grained to only retry specific exceptions, or log them together with the retryCount - logger
-
Method to log messages upon failure
- t
-
The code block that we want to retry
- timeoutMillis
-
How much time we want to allow t to run. If passed, runs t in a separate thread and throws a
TimeoutException
if it takes too long
Attributes
- Returns
-
the value of evaluating t, or throws an exception if evaluating t fails more than count times
- Companion
- object
- Source
- Retry.scala
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any
Members list
In this article