atmos
package atmos
The atmos
package aims to provide a concise mechanism for implementing retry-on-failure behavior.
Retry behavior is controlled by an instance of atmos.RetryPolicy configured with strategies for various components of the retry operation. The elements that define a retry policy are:
- atmos.ResultClassifier: Defines what results are acceptable for a retry operation to return.
- atmos.ErrorClassifier: Defines when a retry operation should be interrupted by a fatal error.
- atmos.BackoffPolicy: Defines how long to wait between successive retry attempts. The atmos.backoff package provides a number of common backoff policy implementations.
- atmos.EventMonitor: An interface that is notified of events during a retry operation. The atmos.monitor package provides a number of common event monitor implementations.
- atmos.TerminationPolicy: Defines when a retry operation should abort and make no further attempts. The atmos.termination package provides a number of common termination policy implementations.
Additionally, the atmos.dsl package provides a concise DSL for describing retry policies.
For more information about using the atmos
library, see http://zman.io/atmos
- Alphabetic
- By Inheritance
- atmos
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
trait
BackoffPolicy
extends AnyRef
A strategy for computing a sequence of wait durations for use between retry attempts.
-
sealed
trait
ErrorClassification
extends AnyRef
Base type for error classifications.
-
type
ErrorClassifier = PartialFunction[Throwable, ErrorClassification]
The type of error classifier functions.
-
trait
EventMonitor
extends AnyRef
A monitor that is notified of events that occur while a retry operation is in progress.
-
sealed
trait
ResultClassification
extends AnyRef
Base type for result classifications.
-
type
ResultClassifier = PartialFunction[Any, ResultClassification]
The type of result classifier functions.
-
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.
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.
-
trait
TerminationPolicy
extends AnyRef
Strategy for determining when to abort a retry operation.
Value Members
-
object
ErrorClassification
extends (Throwable) ⇒ ErrorClassification
Definitions of the supported error classifications and the default classification function.
-
object
ErrorClassifier
Common error classifiers.
-
object
ResultClassification
extends (Any) ⇒ ResultClassification
Definitions of the supported result classifications and the default classification function.
-
object
ResultClassifier
Common result classifiers.
-
object
RetryPolicy
extends Serializable
Factory for retry policies.