An implementation of the Clock
service backed by a java.time.Clock
.
Get the current time, represented in the current timezone.
Returns the current time, relative to the Unix epoch.
Constructs a Clock
service from a java.time.Clock
.
Returns the system nano time, which is not relative to any date.
Returns a new effect that repeats this effect according to the specified schedule or until the first failure.
Returns a new effect that repeats this effect according to the specified
schedule or until the first failure. Scheduled recurrences are in addition
to the first execution, so that io.repeat(Schedule.once)
yields an effect
that executes io
, and then if that succeeds, executes io
an additional
time.
Returns a new effect that repeats this effect according to the specified schedule or until the first failure, at which point, the failure value and schedule output are passed to the specified handler.
Returns a new effect that repeats this effect according to the specified schedule or until the first failure, at which point, the failure value and schedule output are passed to the specified handler.
Scheduled recurrences are in addition to the first execution, so that
io.repeat(Schedule.once)
yields an effect that executes io
, and then if
that succeeds, executes io
an additional time.
Returns a new effect that repeats this effect according to the specified schedule or until the first failure, at which point, the failure value and schedule output are passed to the specified handler.
Returns a new effect that repeats this effect according to the specified schedule or until the first failure, at which point, the failure value and schedule output are passed to the specified handler.
Scheduled recurrences are in addition to the first execution, so that
io.repeat(Schedule.once)
yields an effect that executes io
, and then if
that succeeds, executes io
an additional time.
Retries with the specified retry policy.
Retries with the specified retry policy. Retries are done following the
failure of the original io
(up to a fixed maximum with once
or recurs
for example), so that that io.retry(Schedule.once)
means "execute io
and in case of failure, try again once".
Retries with the specified schedule, until it fails, and then both the value produced by the schedule together with the last error are passed to the recovery function.
Returns an effect that retries this effect with the specified schedule when it fails, until the schedule is done, then both the value produced by the schedule together with the last error are passed to the specified recovery function.
Runs this effect according to the specified schedule.
Runs this effect according to the specified schedule.
See scheduleFrom for a variant that allows the schedule's decision to depend on the result of this effect.
Runs this effect according to the specified schedule starting from the specified input value.
Returns the scheduler used for scheduling effects.
Sleeps for the specified duration.
Sleeps for the specified duration. This is always asynchronous.