A Schedule[Env, In, Out]
defines a recurring schedule, which consumes values of type In
, and which returns values of type Out
.
Schedules are defined as a possibly infinite set of intervals spread out over time. Each interval defines a window in which recurrence is possible.
When schedules are used to repeat or retry effects, the starting boundary of each interval produced by a schedule is used as the moment when the effect will be executed again.
Schedules compose in the following primary ways:
- Union. This performs the union of the intervals of two schedules. * Intersection. This performs the intersection of the intervals of two schedules. * Sequence. This concatenates the intervals of one schedule onto another.
In addition, schedule inputs and outputs can be transformed, filtered (to terminate a schedule early in response to some input or output), and so forth.
A variety of other operators exist for transforming and combining schedules, and the companion object for Schedule
contains all common types of schedules, both for performing retrying, as well as performing repetition.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Serializableclass Objecttrait Matchableclass Any
- Self type
-
Members list
Type members
Types
Value members
Concrete methods
Returns a new schedule that performs a geometric intersection on the intervals defined by both schedules.
Returns a new schedule that performs a geometric intersection on the intervals defined by both schedules.
Attributes
Returns a new schedule that has both the inputs and outputs of this and the specified schedule.
Returns a new schedule that has both the inputs and outputs of this and the specified schedule.
Attributes
The same as &&
, but ignores the left output.
The same as &&
, but ignores the left output.
Attributes
A symbolic alias for andThen
.
A symbolic alias for andThen
.
Attributes
Returns a new schedule that allows choosing between feeding inputs to this schedule, or feeding inputs to the specified schedule.
Returns a new schedule that allows choosing between feeding inputs to this schedule, or feeding inputs to the specified schedule.
Attributes
The same as &&
, but ignores the right output.
The same as &&
, but ignores the right output.
Attributes
An operator alias for zip
.
An operator alias for zip
.
Attributes
A backwards version of >>>
.
A backwards version of >>>
.
Attributes
Operator alias for andThenEither
.
Operator alias for andThenEither
.
Attributes
Returns the composition of this schedule and the specified schedule, by piping the output of this one into the input of the other. Effects described by this schedule will always be executed before the effects described by the second schedule.
Returns the composition of this schedule and the specified schedule, by piping the output of this one into the input of the other. Effects described by this schedule will always be executed before the effects described by the second schedule.
Attributes
Returns a new schedule with the given delay added to every interval defined by this schedule.
Returns a new schedule with the given delay added to every interval defined by this schedule.
Attributes
Returns a new schedule with the given effectfully computed delay added to every interval defined by this schedule.
Returns a new schedule with the given effectfully computed delay added to every interval defined by this schedule.
Attributes
The same as andThenEither
, but merges the output.
The same as andThenEither
, but merges the output.
Attributes
Returns a new schedule that first executes this schedule to completion, and then executes the specified schedule to completion.
Returns a new schedule that first executes this schedule to completion, and then executes the specified schedule to completion.
Attributes
Returns a new schedule that maps this schedule to a constant output.
Returns a new schedule that maps this schedule to a constant output.
Attributes
Returns a new schedule that passes each input and output of this schedule to the specified function, and then determines whether or not to continue based on the return value of the function.
Returns a new schedule that passes each input and output of this schedule to the specified function, and then determines whether or not to continue based on the return value of the function.
Attributes
Returns a new schedule that passes each input and output of this schedule to the specified function, and then determines whether or not to continue based on the return value of the function.
Returns a new schedule that passes each input and output of this schedule to the specified function, and then determines whether or not to continue based on the return value of the function.
Attributes
Returns a new schedule that collects the outputs of this one into a chunk.
Returns a new schedule that collects the outputs of this one into a chunk.
Attributes
Returns a new schedule that collects the outputs of this one into a list until the condition f fails.
Returns a new schedule that collects the outputs of this one into a list until the condition f fails.
Attributes
Returns a new schedule that collects the outputs of this one into a list until the effectual condition f fails.
Returns a new schedule that collects the outputs of this one into a list until the effectual condition f fails.
Attributes
Returns a new schedule that collects the outputs of this one into a list as long as the condition f holds.
Returns a new schedule that collects the outputs of this one into a list as long as the condition f holds.
Attributes
Returns a new schedule that collects the outputs of this one into a list as long as the effectual condition f holds.
Returns a new schedule that collects the outputs of this one into a list as long as the effectual condition f holds.
Attributes
A named alias for <<<
.
A named alias for <<<
.
Attributes
Returns a new schedule that deals with a narrower class of inputs than this schedule.
Returns a new schedule that deals with a narrower class of inputs than this schedule.
Attributes
Returns a new schedule that deals with a narrower class of inputs than this schedule.
Returns a new schedule that deals with a narrower class of inputs than this schedule.
Attributes
Returns a new schedule with the specified effectfully computed delay added before the start of each interval produced by this schedule.
Returns a new schedule with the specified effectfully computed delay added before the start of each interval produced by this schedule.
Attributes
Returns a new schedule with the specified effectfully computed delay added before the start of each interval produced by this schedule.
Returns a new schedule with the specified effectfully computed delay added before the start of each interval produced by this schedule.
Attributes
Returns a new schedule that outputs the delay between each occurence.
Returns a new schedule that outputs the delay between each occurence.
Attributes
Returns a new schedule that contramaps the input and maps the output.
Returns a new schedule that contramaps the input and maps the output.
Attributes
Returns a new schedule that contramaps the input and maps the output.
Returns a new schedule that contramaps the input and maps the output.
Attributes
Returns a driver that can be used to step the schedule, appropriately handling sleeping.
Returns a driver that can be used to step the schedule, appropriately handling sleeping.
Attributes
A named alias for ||
.
A named alias for ||
.
Attributes
The same as either
followed by map
.
The same as either
followed by map
.
Attributes
Returns a new schedule that will run the specified finalizer as soon as the schedule is complete. Note that unlike ZIO#ensuring
, this method does not guarantee the finalizer will be run. The Schedule
may not initialize or the driver of the schedule may not run to completion. However, if the Schedule
ever decides not to continue, then the finalizer will be run.
Returns a new schedule that will run the specified finalizer as soon as the schedule is complete. Note that unlike ZIO#ensuring
, this method does not guarantee the finalizer will be run. The Schedule
may not initialize or the driver of the schedule may not run to completion. However, if the Schedule
ever decides not to continue, then the finalizer will be run.
Attributes
Returns a new schedule that packs the input and output of this schedule into the first element of a tuple. This allows carrying information through this schedule.
Returns a new schedule that packs the input and output of this schedule into the first element of a tuple. This allows carrying information through this schedule.
Attributes
Returns a new schedule that folds over the outputs of this one.
Returns a new schedule that folds over the outputs of this one.
Attributes
Returns a new schedule that effectfully folds over the outputs of this one.
Returns a new schedule that effectfully folds over the outputs of this one.
Attributes
Returns a new schedule that loops this one continuously, resetting the state when this schedule is done.
Returns a new schedule that loops this one continuously, resetting the state when this schedule is done.
Attributes
Returns a new schedule that combines this schedule with the specified schedule, continuing as long as both schedules want to continue and merging the next intervals according to the specified merge function.
Returns a new schedule that combines this schedule with the specified schedule, continuing as long as both schedules want to continue and merging the next intervals according to the specified merge function.
Attributes
Returns a new schedule that randomly modifies the size of the intervals of this schedule.
Returns a new schedule that randomly modifies the size of the intervals of this schedule.
Attributes
Returns a new schedule that randomly modifies the size of the intervals of this schedule.
Returns a new schedule that randomly modifies the size of the intervals of this schedule.
The new interval size is between min * old interval size
and max * old interval size
.
Research shows that jittered(0.0, 1.0)
is a suitable range for a retrying schedule.
Attributes
Returns a new schedule that makes this schedule available on the Left
side of an Either
input, allowing propagating some type X
through this channel on demand.
Returns a new schedule that makes this schedule available on the Left
side of an Either
input, allowing propagating some type X
through this channel on demand.
Attributes
Returns a new schedule that maps the output of this schedule through the specified function.
Returns a new schedule that maps the output of this schedule through the specified function.
Attributes
Returns a new schedule that maps the output of this schedule through the specified effectful function.
Returns a new schedule that maps the output of this schedule through the specified effectful function.
Attributes
Returns a new schedule that modifies the delay using the specified function.
Returns a new schedule that modifies the delay using the specified function.
Attributes
Returns a new schedule that modifies the delay using the specified effectual function.
Returns a new schedule that modifies the delay using the specified effectual function.
Attributes
Returns a new schedule that applies the current one but runs the specified effect for every decision of this schedule. This can be used to create schedules that log failures, decisions, or computed values.
Returns a new schedule that applies the current one but runs the specified effect for every decision of this schedule. This can be used to create schedules that log failures, decisions, or computed values.
Attributes
Returns a new schedule that passes through the inputs of this schedule.
Returns a new schedule that passes through the inputs of this schedule.
Attributes
Returns a new schedule with its environment provided to it, so the resulting schedule does not require any environment.
Returns a new schedule with its environment provided to it, so the resulting schedule does not require any environment.
Attributes
Transforms the environment being provided to this schedule with the specified function.
Transforms the environment being provided to this schedule with the specified function.
Attributes
Returns a new schedule that reconsiders every decision made by this schedule, possibly modifying the next interval and the output type in the process.
Returns a new schedule that reconsiders every decision made by this schedule, possibly modifying the next interval and the output type in the process.
Attributes
Returns a new schedule that effectfully reconsiders every decision made by this schedule, possibly modifying the next interval and the output type in the process.
Returns a new schedule that effectfully reconsiders every decision made by this schedule, possibly modifying the next interval and the output type in the process.
Attributes
Returns a new schedule that outputs the number of repetitions of this one.
Returns a new schedule that outputs the number of repetitions of this one.
Attributes
Return a new schedule that automatically resets the schedule to its initial state after some time of inactivity defined by duration
.
Return a new schedule that automatically resets the schedule to its initial state after some time of inactivity defined by duration
.
Attributes
Resets the schedule when the specified predicate on the schedule output evaluates to true.
Resets the schedule when the specified predicate on the schedule output evaluates to true.
Attributes
Returns a new schedule that makes this schedule available on the Right
side of an Either
input, allowing propagating some type X
through this channel on demand.
Returns a new schedule that makes this schedule available on the Right
side of an Either
input, allowing propagating some type X
through this channel on demand.
Attributes
Runs a schedule using the provided inputs, and collects all outputs.
Runs a schedule using the provided inputs, and collects all outputs.
Attributes
Returns a new schedule that packs the input and output of this schedule into the second element of a tuple. This allows carrying information through this schedule.
Returns a new schedule that packs the input and output of this schedule into the second element of a tuple. This allows carrying information through this schedule.
Attributes
Returns a new schedule that effectfully processes every input to this schedule.
Returns a new schedule that effectfully processes every input to this schedule.
Attributes
Returns a new schedule that effectfully processes every output from this schedule.
Returns a new schedule that effectfully processes every output from this schedule.
Attributes
Returns a new schedule that combines this schedule with the specified schedule, continuing as long as either schedule wants to continue and merging the next intervals according to the specified merge function.
Returns a new schedule that combines this schedule with the specified schedule, continuing as long as either schedule wants to continue and merging the next intervals according to the specified merge function.
Attributes
Returns a new schedule that maps the output of this schedule to unit.
Returns a new schedule that maps the output of this schedule to unit.
Attributes
Returns a new schedule that continues until the specified predicate on the input evaluates to true.
Returns a new schedule that continues until the specified predicate on the input evaluates to true.
Attributes
Returns a new schedule that continues until the specified effectful predicate on the input evaluates to true.
Returns a new schedule that continues until the specified effectful predicate on the input evaluates to true.
Attributes
Returns a new schedule that continues until the specified predicate on the output evaluates to true.
Returns a new schedule that continues until the specified predicate on the output evaluates to true.
Attributes
Returns a new schedule that continues until the specified effectful predicate on the output evaluates to true.
Returns a new schedule that continues until the specified effectful predicate on the output evaluates to true.
Attributes
A schedule that recurs during the given duration
A schedule that recurs during the given duration
Attributes
Returns a new schedule that continues for as long the specified predicate on the input evaluates to true.
Returns a new schedule that continues for as long the specified predicate on the input evaluates to true.
Attributes
Returns a new schedule that continues for as long the specified effectful predicate on the input evaluates to true.
Returns a new schedule that continues for as long the specified effectful predicate on the input evaluates to true.
Attributes
Returns a new schedule that continues for as long the specified predicate on the output evaluates to true.
Returns a new schedule that continues for as long the specified predicate on the output evaluates to true.
Attributes
Returns a new schedule that continues for as long the specified effectful predicate on the output evaluates to true.
Returns a new schedule that continues for as long the specified effectful predicate on the output evaluates to true.
Attributes
A named method for &&
.
A named method for &&
.
Attributes
The same as &&
, but ignores the right output.
The same as &&
, but ignores the right output.
Attributes
The same as &&
, but ignores the left output.
The same as &&
, but ignores the left output.
Attributes
Equivalent to zip
followed by map
.
Equivalent to zip
followed by map
.
Attributes
Returns a new schedule that performs a geometric union on the intervals defined by both schedules.
Returns a new schedule that performs a geometric union on the intervals defined by both schedules.
Attributes
Returns a new schedule that chooses between two schedules with a common output.
Returns a new schedule that chooses between two schedules with a common output.