ox.scheduling
Members list
Type members
Classlikes
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 started. 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.StartToStart and a ScheduledConfig.afterAttempt callback which checks if the result was successful.
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 schedule which determines the intervals between invocations and number of attempts to execute the operation.
- 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
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Describes a schedule according to which ox.resilience.retry, repeat and schedule will invoke operations. A schedule is essentially a list of intervals, which are used to determine how long to wait before subsequent invocations of the operation.
Describes a schedule according to which ox.resilience.retry, repeat and schedule will invoke operations. A schedule is essentially a list of intervals, which are used to determine how long to wait before subsequent invocations of the operation.
Implementation note: the intervals lazy-list is lazy-evaluated itself, to avoid memory leaks when a schedule is captured as a value and used multiple times. The intervals list is re-created on every usage, which isn't optimal, but due to the small size (and gradual evaluation) of the list, should not cause any performance issues.
Value parameters
- initialDelay
-
The delay to wait before running the operation for the first time - if any.
- intervals
-
The intervals to use for the schedule.
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- See also
-
ScheduleConfig.afterAttempt
- Companion
- object
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- enum
- Supertypes
-
trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
ScheduleStop.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
- afterAttempt
-
A callback invoked after every attempt, with the current invocation number (starting from 1) and the result of the operation. Might decide to short-circuit further attempts, and stop the schedule. Schedule configuration (e.g. max number of attempts) takes precedence.
- schedule
-
The schedule which determines the maximum number of invocations and the duration between subsequent invocations. See Schedule for more details.
- 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.
Value parameters
- config
-
The repeat config. Includes a Schedule which determines the intervals between invocations and number of repetitions of the operation.
- 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 a direct result until it succeeds or the config decides to stop. Uses the default RepeatConfig, with the given Schedule.
Repeats an operation returning a direct result until it succeeds or the config decides to stop. Uses the default RepeatConfig, with the given Schedule.
repeat is a special case of scheduled with a given set of defaults.
Value parameters
- operation
-
The operation to repeat.
- schedule
-
The schedule which determines the intervals between invocations and number of attempts to execute the operation.
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.
Value parameters
- config
-
The repeat config. Includes a Schedule which determines the intervals between invocations and number of repetitions of the operation.
- operation
-
The operation to repeat.
Attributes
- Returns
-
The result of 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. Uses the default RepeatConfig, with the given Schedule.
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. Uses the default RepeatConfig, with the given Schedule.
repeatEither is a special case of scheduledEither with a given set of defaults.
Value parameters
- operation
-
The operation to repeat.
- schedule
-
The schedule which determines the intervals between invocations and number of attempts to execute the operation.
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.
Value parameters
- config
-
The repeat config. Includes a Schedule which determines the intervals between invocations and number of repetitions of the operation.
- 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
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. Uses the default RepeatConfig, with the given Schedule.
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. Uses the default RepeatConfig, with the given Schedule.
repeatWithErrorMode is a special case of scheduledWithErrorMode with a given set of defaults.
Value parameters
- em
-
The error mode to use, which specifies when a result value is considered success, and when a failure.
- operation
-
The operation to repeat.
- schedule
-
The schedule which determines the intervals between invocations and number of attempts to execute the operation.
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.