object Schedule extends Serializable
- Alphabetic
- By Inheritance
- Schedule
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- sealed trait Decision[-Env, -In, +Out] extends AnyRef
- final case class Driver[-Env, -In, +Out](next: (In) => ZIO[Env, None.type, Out], last: IO[NoSuchElementException, Out], reset: UIO[Unit]) extends Product with Serializable
- type Interval = OffsetDateTime
- final class ProvideSomeLayer[Env0 <: Has[_], -Env, -In, +Out] extends AnyVal
- type StepFunction[-Env, -In, +Out] = (OffsetDateTime, In) => ZIO[Env, Nothing, Decision[Env, In, Out]]
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def apply[Env, In, Out](step: StepFunction[Env, In, Out]): Schedule[Env, In, Out]
Constructs a new schedule from the specified step function.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- def collectAll[A]: Schedule[Any, A, Chunk[A]]
A schedule that recurs anywhere, collecting all inputs into a list.
- def collectUntil[A](f: (A) => Boolean): Schedule[Any, A, Chunk[A]]
A schedule that recurs until the condition f fails, collecting all inputs into a list.
- def collectUntilM[Env, A](f: (A) => URIO[Env, Boolean]): Schedule[Env, A, Chunk[A]]
A schedule that recurs until the effectful condition f fails, collecting all inputs into a list.
- def collectWhile[A](f: (A) => Boolean): Schedule[Any, A, Chunk[A]]
A schedule that recurs as long as the condition f holds, collecting all inputs into a list.
- def collectWhileM[Env, A](f: (A) => URIO[Env, Boolean]): Schedule[Env, A, Chunk[A]]
A schedule that recurs as long as the effectful condition holds, collecting all inputs into a list.
- val count: Schedule[Any, Any, Long]
A schedule that always recurs, which counts the number of recurrences.
- def dayOfMonth(day: Int): Schedule[Any, Any, Long]
Cron-like schedule that recurs every specified
day
of month.Cron-like schedule that recurs every specified
day
of month. Won't recur on months containing less days than specified inday
param.It triggers at zero hour of the day. Producing a count of repeats: 0, 1, 2.
NOTE:
day
parameter is validated lazily. Must be in range 1...31. - def dayOfWeek(day: Int): Schedule[Any, Any, Long]
Cron-like schedule that recurs every specified
day
of each week.Cron-like schedule that recurs every specified
day
of each week. It triggers at zero hour of the week. Producing a count of repeats: 0, 1, 2.NOTE:
day
parameter is validated lazily. Must be in range 1 (Monday)...7 (Sunday). - def delayed[Env, In, Out](schedule: Schedule[Env, In, Duration]): Schedule[Env, In, Duration]
Takes a schedule that produces a delay, and returns a new schedule that uses this delay to further delay intervals in the resulting schedule.
- def duration(duration: Duration): Schedule[Any, Any, Duration]
A schedule that can recur one time, the specified amount of time into the future.
- val elapsed: Schedule[Any, Any, Duration]
A schedule that occurs everywhere, which returns the total elapsed duration since the first step.
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def exponential(base: Duration, factor: Double = 2.0): Schedule[Any, Any, Duration]
A schedule that always recurs, but will wait a certain amount between repetitions, given by
base * factor.pow(n)
, wheren
is the number of repetitions so far.A schedule that always recurs, but will wait a certain amount between repetitions, given by
base * factor.pow(n)
, wheren
is the number of repetitions so far. Returns the current duration between recurrences. - def fibonacci(one: Duration): Schedule[Any, Any, Duration]
A schedule that always recurs, increasing delays by summing the preceding two delays (similar to the fibonacci sequence).
A schedule that always recurs, increasing delays by summing the preceding two delays (similar to the fibonacci sequence). Returns the current duration between recurrences.
- def fixed(interval: Duration): Schedule[Any, Any, Long]
A schedule that recurs on a fixed interval.
A schedule that recurs on a fixed interval. Returns the number of repetitions of the schedule so far.
If the action run between updates takes longer than the interval, then the action will be run immediately, but re-runs will not "pile up".
|-----interval-----|-----interval-----|-----interval-----| |---------action--------||action|-----|action|-----------|
- val forever: Schedule[Any, Any, Long]
A schedule that always recurs, producing a count of repeats: 0, 1, 2.
- def fromDuration(duration: Duration): Schedule[Any, Any, Duration]
A schedule that recurs once with the specified delay.
- def fromDurations(duration: Duration, durations: Duration*): Schedule[Any, Any, Duration]
A schedule that recurs once for each of the specified durations, delaying each time for the length of the specified duration.
A schedule that recurs once for each of the specified durations, delaying each time for the length of the specified duration. Returns the length of the current duration between recurrences.
- def fromFunction[A, B](f: (A) => B): Schedule[Any, A, B]
A schedule that always recurs, mapping input values through the specified function.
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def hourOfDay(hour: Int): Schedule[Any, Any, Long]
Cron-like schedule that recurs every specified
hour
of each day.Cron-like schedule that recurs every specified
hour
of each day. It triggers at zero minute of the hour. Producing a count of repeats: 0, 1, 2.NOTE:
hour
parameter is validated lazily. Must be in range 0...23. - def identity[A]: Schedule[Any, A, A]
A schedule that always recurs, which returns inputs as outputs.
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def linear(base: Duration): Schedule[Any, Any, Duration]
A schedule that always recurs, but will repeat on a linear time interval, given by
base * n
wheren
is the number of repetitions so far.A schedule that always recurs, but will repeat on a linear time interval, given by
base * n
wheren
is the number of repetitions so far. Returns the current duration between recurrences. - def maxOffsetDateTime(l: OffsetDateTime, r: OffsetDateTime): OffsetDateTime
- def minOffsetDateTime(l: OffsetDateTime, r: OffsetDateTime): OffsetDateTime
- def minuteOfHour(minute: Int): Schedule[Any, Any, Long]
Cron-like schedule that recurs every specified
minute
of each hour.Cron-like schedule that recurs every specified
minute
of each hour. It triggers at zero second of the minute. Producing a count of repeats: 0, 1, 2.NOTE:
minute
parameter is validated lazily. Must be in range 0...59. - final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- val once: Schedule[Any, Any, Unit]
A schedule that recurs one time.
- def recurUntil[A, B](pf: PartialFunction[A, B]): Schedule[Any, A, Option[B]]
A schedule that recurs for until the input value becomes applicable to partial function and then map that value with given function.
- def recurUntil[A](f: (A) => Boolean): Schedule[Any, A, A]
A schedule that recurs for until the predicate evaluates to true.
- def recurUntilEquals[A](a: => A): Schedule[Any, A, A]
A schedule that recurs for until the predicate is equal.
- def recurUntilM[Env, A](f: (A) => URIO[Env, Boolean]): Schedule[Env, A, A]
A schedule that recurs for until the predicate evaluates to true.
- def recurWhile[A](f: (A) => Boolean): Schedule[Any, A, A]
A schedule that recurs for as long as the predicate evaluates to true.
- def recurWhileEquals[A](a: => A): Schedule[Any, A, A]
A schedule that recurs for as long as the predicate is equal.
- def recurWhileM[Env, A](f: (A) => URIO[Env, Boolean]): Schedule[Env, A, A]
A schedule that recurs for as long as the effectful predicate evaluates to true.
- def recurs(n: Int): Schedule[Any, Any, Long]
A schedule spanning all time, which can be stepped only the specified number of times before it terminates.
- def recurs(n: Long): Schedule[Any, Any, Long]
A schedule spanning all time, which can be stepped only the specified number of times before it terminates.
- def secondOfMinute(second: Int): Schedule[Any, Any, Long]
Cron-like schedule that recurs every specified
second
of each minute.Cron-like schedule that recurs every specified
second
of each minute. It triggers at zero nanosecond of the second. Producing a count of repeats: 0, 1, 2.NOTE:
second
parameter is validated lazily. Must be in range 0...59. - def spaced(duration: Duration): Schedule[Any, Any, Long]
Returns a schedule that recurs continuously, each repetition spaced the specified duration from the last run.
- val stop: Schedule[Any, Any, Unit]
A schedule that does not recur, it just stops.
- def succeed[A](a: => A): Schedule[Any, Any, A]
Returns a schedule that repeats one time, producing the specified constant value.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def unfold[A](a: => A)(f: (A) => A): Schedule[Any, Any, A]
Unfolds a schedule that repeats one time from the specified state and iterator.
- def unwrap[R, A, B](zio: ZIO[R, Nothing, Schedule[R, A, B]]): Schedule[R, A, B]
Extracts a Schedule out of an effect.
- def upTo(duration: Duration): Schedule[Any, Any, Duration]
A schedule that recurs during the given duration
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def windowed(interval: Duration): Schedule[Any, Any, Long]
A schedule that divides the timeline to
interval
-long windows, and sleeps until the nearest window boundary every time it recurs.A schedule that divides the timeline to
interval
-long windows, and sleeps until the nearest window boundary every time it recurs.For example,
windowed(10.seconds)
would produce a schedule as follows:10s 10s 10s 10s |----------|----------|----------|----------| |action------|sleep---|act|-sleep|action----|
- object Decision
- object StepFunction