RepeatConfig

ox.scheduling.RepeatConfig
case class RepeatConfig[E, T](schedule: Schedule, shouldContinueOnResult: T => Boolean)

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 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

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

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

Members list

Value members

Concrete methods

def schedule(newSchedule: Schedule): RepeatConfig[E, T]
def shouldContinueOnResult(newShouldContinueOnResult: T => Boolean): RepeatConfig[E, T]

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product