ResultPolicy

ox.retry.ResultPolicy
See theResultPolicy companion object
case class ResultPolicy[E, T](isSuccess: T => Boolean, isWorthRetrying: E => Boolean)

A policy that allows to customize when a non-erroneous result is considered successful and when an error is worth retrying (which allows for failing fast on certain errors).

Type parameters

E

The error type of the operation. For operations returning a T or a Try[T], this is fixed to Throwable. For operations returning an Either[E, T], this can be any E.

T

The successful result type for the operation.

Value parameters

isSuccess

A function that determines whether a non-erroneous result is considered successful. By default, every non-erroneous result is considered successful.

isWorthRetrying

A function that determines whether an error is worth retrying. By default, all errors are retried.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product