case class RetryPolicy(termination: TerminationPolicy = RetryPolicy.defaultTermination, backoff: BackoffPolicy = RetryPolicy.defaultBackoff, monitor: EventMonitor = RetryPolicy.defaultMonitor, classifier: ErrorClassifier = RetryPolicy.defaultErrors, results: ResultClassifier = RetryPolicy.defaultResults, errors: ErrorClassifier = RetryPolicy.defaultErrors) extends Product with Serializable
A policy that enables customizable retries for arbitrary operations.
- termination
The strategy for determining when to abort a retry operation.
- backoff
The strategy used to calculate delays between retries.
- monitor
The monitor that is notified of retry events.
- classifier
The classifier for errors raised during retry operations. This field is deprecated and will be used as a fallback for the
errors
classifier, which should be used instead.- results
The classifier for results returned during retry operations.
- errors
The classifier for errors raised during retry operations.
- Alphabetic
- By Inheritance
- RetryPolicy
- Serializable
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
RetryPolicy(termination: TerminationPolicy = RetryPolicy.defaultTermination, backoff: BackoffPolicy = RetryPolicy.defaultBackoff, monitor: EventMonitor = RetryPolicy.defaultMonitor, classifier: ErrorClassifier = RetryPolicy.defaultErrors, results: ResultClassifier = RetryPolicy.defaultResults, errors: ErrorClassifier = RetryPolicy.defaultErrors)
- termination
The strategy for determining when to abort a retry operation.
- backoff
The strategy used to calculate delays between retries.
- monitor
The monitor that is notified of retry events.
- classifier
The classifier for errors raised during retry operations. This field is deprecated and will be used as a fallback for the
errors
classifier, which should be used instead.- results
The classifier for results returned during retry operations.
- errors
The classifier for errors raised during retry operations.
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- val backoff: BackoffPolicy
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- val errors: ErrorClassifier
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val monitor: EventMonitor
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- val results: ResultClassifier
-
def
retry[T](name: Option[String])(operation: ⇒ T)(implicit clock: Clock): T
Performs the specified optionally named operation synchronously, retrying according to this policy.
Performs the specified optionally named operation synchronously, retrying according to this policy.
- T
The return type of the operation being retried.
- name
The optional name of the operation.
- operation
The operation to repeatedly perform.
- clock
The clock used to track time and wait out backoff delays.
-
def
retry[T](name: String)(operation: ⇒ T)(implicit clock: Clock): T
Performs the specified named operation synchronously, retrying according to this policy.
Performs the specified named operation synchronously, retrying according to this policy.
- T
The return type of the operation being retried.
- name
The name of the operation.
- operation
The operation to repeatedly perform.
- clock
The clock used to track time and wait out backoff delays.
-
def
retry[T]()(operation: ⇒ T)(implicit clock: Clock): T
Performs the specified operation synchronously, retrying according to this policy.
Performs the specified operation synchronously, retrying according to this policy.
- T
The return type of the operation being retried.
- operation
The operation to repeatedly perform.
- clock
The clock used to track time and wait out backoff delays.
-
def
retryAsync[T](name: Option[String])(operation: ⇒ Future[T])(implicit ec: ExecutionContext, clock: Clock): Future[T]
Performs the specified optionally named operation asynchronously, retrying according to this policy.
Performs the specified optionally named operation asynchronously, retrying according to this policy.
- T
The return type of the operation being retried.
- name
The optional name of the operation.
- operation
The operation to repeatedly perform.
- ec
The execution context to retry on.
- clock
The clock used to track time and schedule backoff notifications.
-
def
retryAsync[T](name: String)(operation: ⇒ Future[T])(implicit ec: ExecutionContext, clock: Clock): Future[T]
Performs the specified optionally named operation asynchronously, retrying according to this policy.
Performs the specified optionally named operation asynchronously, retrying according to this policy.
- T
The return type of the operation being retried.
- name
The name of the operation.
- operation
The operation to repeatedly perform.
- ec
The execution context to retry on.
- clock
The clock used to track time and schedule backoff notifications.
-
def
retryAsync[T]()(operation: ⇒ Future[T])(implicit ec: ExecutionContext, clock: Clock): Future[T]
Performs the specified operation asynchronously, retrying according to this policy.
Performs the specified operation asynchronously, retrying according to this policy.
- T
The return type of the operation being retried.
- operation
The operation to repeatedly perform.
- ec
The execution context to retry on.
- clock
The clock used to track time and schedule backoff notifications.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- val termination: TerminationPolicy
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
Deprecated Value Members
-
val
classifier: ErrorClassifier
- Annotations
- @deprecated
- Deprecated
(Since version 2.1) Use
errors
instead ofclassifier
.