Retry

mill.util.Retry
@Scaladoc(value = "/**\n * Generic retry functionality\n *\n * @param count How many times to retry before giving up\n * @param backoffMillis What is the initial backoff time\n * @param backoffMultiplier How much to multiply the initial backoff each time\n * @param timeoutMillis How much time we want to allow [[t]] to run. If passed,\n * runs [[t]] in a separate thread and throws a `TimeoutException`\n * if it takes too long\n * @param filter Whether or not we want to retry a given exception at a given retryCount;\n * defaults to `true` to retry all exceptions, but can be made more fine-grained\n * to only retry specific exceptions, or log them together with the retryCount\n * @param t The code block that we want to retry\n * @return the value of evaluating [[t]], or throws an exception if evaluating\n * [[t]] fails more than [[count]] times\n */")
case class Retry(count: Int, backoffMillis: Long, backoffMultiplier: Double, timeoutMillis: Long, filter: (Int, Throwable) => Boolean)

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

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

Source
Retry.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def apply[T](t: => T): T

Attributes

Source
Retry.scala
def indexed[T](t: Int => T): T

Attributes

Source
Retry.scala

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product