ox.scheduling
Members list
Type members
Classlikes
A random factor used for calculating the delay between subsequent retries when a backoff strategy is used for calculating the delay.
A random factor used for calculating the delay between subsequent retries when a backoff strategy is used for calculating the delay.
The purpose of jitter is to avoid clustering of subsequent retries, i.e. to reduce the number of clients calling a service exactly at the same time - which can result in subsequent failures, contrary to what you would expect from retrying. By introducing randomness to the delays, the retries become more evenly distributed over time.
See the AWS Architecture Blog article on backoff and jitter for a more in-depth explanation.
Depending on the algorithm, the jitter can affect the delay in different ways - see the concrete variants for more details.
Attributes
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
A config that defines how to repeat an operation.
A config that defines how to repeat an operation.
Schedule provides the interval between subsequent invocations, which guarantees that the next operation will start no sooner than the specified duration after the previous operations has finished. If the previous operation takes longer than the interval, the next operation will start immediately after the previous one has finished.
It is a special case of ScheduledConfig with ScheduledConfig.sleepMode always set to SleepMode.Interval and ScheduledConfig.shouldContinueOnError always returning false
.
Type parameters
- E
-
The error type of the operation. For operations returning a
T
or aTry[T]
, this is fixed toThrowable
. For operations returning anEither[E, T]
, this can be anyE
. - T
-
The successful result type for the operation.
Value parameters
- schedule
-
The repeat schedule which determines the maximum number of invocations and the interval between subsequent invocations. See Schedule for more details.
- shouldContinueOnResult
-
A function that determines whether to continue the loop after a success. The function receives the value that was emitted by the last invocation. Defaults to => true.
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
RepeatConfig.type
A config that defines how to schedule an operation.
A config that defines how to schedule an operation.
Type parameters
- E
-
The error type of the operation. For operations returning a
T
or aTry[T]
, this is fixed toThrowable
. For operations returning anEither[E, T]
, this can be anyE
. - T
-
The successful result type for the operation.
Value parameters
- onOperationResult
-
A function that is invoked after each invocation. The callback receives the number of the current invocations number (starting from 1) and the result of the operation. The result is either a successful value or an error.
- schedule
-
The schedule which determines the maximum number of invocations and the duration between subsequent invocations. See Schedule for more details.
- shouldContinueOnError
-
A function that determines whether to continue the loop after an error. The function receives the error that was emitted by the last invocation. Defaults to => false.
- shouldContinueOnResult
-
A function that determines whether to continue the loop after a success. The function receives the value that was emitted by the last invocation. Defaults to => true.
- sleepMode
-
The mode that specifies how to interpret the duration provided by the schedule. See SleepMode for more details.
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
The mode that specifies how to interpret the duration provided by the schedule.
The mode that specifies how to interpret the duration provided by the schedule.
Attributes
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Value members
Concrete methods
Repeats an operation returning a direct result until it succeeds or the config decides to stop.
Repeats an operation returning a direct result until it succeeds or the config decides to stop.
repeat is a special case of scheduled with a given set of defaults. See RepeatConfig for more details.
Value parameters
- config
-
The repeat config - see RepeatConfig.
- operation
-
The operation to repeat.
Attributes
- Returns
-
The result of the last invocation if the config decides to stop.
- Throws
-
anything
The exception thrown by the last invocation if the config decides to stop.
- See also
Repeats an operation returning an scala.util.Either until the config decides to stop. Note that any exceptions thrown by the operation aren't caught and effectively interrupt the repeat loop.
Repeats an operation returning an scala.util.Either until the config decides to stop. Note that any exceptions thrown by the operation aren't caught and effectively interrupt the repeat loop.
repeatEither is a special case of scheduledEither with a given set of defaults. See RepeatConfig for more details.
Value parameters
- config
-
The repeat config - see RepeatConfig.
- operation
-
The operation to repeat.
Attributes
- Returns
-
The result of the last invocation if the config decides to stop.
- See also
Repeats an operation using the given error mode until the config decides to stop. Note that any exceptions thrown by the operation aren't caught and effectively interrupt the repeat loop.
Repeats an operation using the given error mode until the config decides to stop. Note that any exceptions thrown by the operation aren't caught and effectively interrupt the repeat loop.
repeatWithErrorMode is a special case of scheduledWithErrorMode with a given set of defaults. See RepeatConfig for more details.
Value parameters
- config
-
The repeat config - see RepeatConfig.
- em
-
The error mode to use, which specifies when a result value is considered success, and when a failure.
- operation
-
The operation to repeat.
Attributes
- Returns
-
The result of the last invocation if the config decides to stop.
- See also
Schedules an operation returning a direct result until it succeeds or the config decides to stop.
Schedules an operation returning a direct result until it succeeds or the config decides to stop.
Value parameters
- config
-
The repeat config - see ScheduledConfig.
- operation
-
The operation to schedule.
Attributes
- Returns
-
The result of the last invocation if the config decides to stop.
- Throws
-
anything
The exception thrown by the last invocation if the config decides to stop.
Schedules an operation returning an scala.util.Either until the config decides to stop. Note that any exceptions thrown by the operation aren't caught and effectively interrupt the schedule loop.
Schedules an operation returning an scala.util.Either until the config decides to stop. Note that any exceptions thrown by the operation aren't caught and effectively interrupt the schedule loop.
Value parameters
- config
-
The schedule config - see ScheduledConfig.
- operation
-
The operation to schedule.
Attributes
- Returns
-
The result of the last invocation if the config decides to stop.
Schedules an operation using the given error mode until the config decides to stop. Note that any exceptions thrown by the operation aren't caught and effectively interrupt the schedule loop.
Schedules an operation using the given error mode until the config decides to stop. Note that any exceptions thrown by the operation aren't caught and effectively interrupt the schedule loop.
Value parameters
- config
-
The schedule config - see ScheduledConfig.
- em
-
The error mode to use, which specifies when a result value is considered success, and when a failure.
- operation
-
The operation to schedule.
Attributes
- Returns
-
The result of the last invocation if the config decides to stop.