cron4zio

package cron4zio

Members list

Concise view

Value members

Concrete methods

def getNextRunDuration(cron: Cron, zoneId: ZoneId): IO[IllegalArgumentException, Duration]

Attributes

Returns:

Duration between current time and next run based on cron,zoneId provided or throws IllegalArgumentException if for a valid cron next run cannot be generated

def parse(cron: String): Try[Cron]

Attributes

Returns:

Cron instance, which corresponds to cron expression received as String or throws IllegalArgumentException if expression does not match cron definition

def repeatEffectForCron[R, E >: Throwable, A](effect: ZIO[R, E, A], cron: Cron, maxRecurs: Int, zoneId: ZoneId): ZIO[R, E, Long]

Attributes

Returns:

This will either return number of times effect ran for cron or will never return anything and keep running forever based on value of param maxRecurs

def repeatEffectsForCron[R, E >: Throwable, A](tasks: List[(ZIO[R, E, A], Cron)], maxRecurs: Int, zoneId: ZoneId): ZIO[R, E, List[Long]]

Attributes

Returns:

This will either return number of times effects ran for cron or will never return anything and keep running all effects forever based on value of param maxRecurs

def sleepForCron(cron: Cron, zoneId: ZoneId): IO[IllegalArgumentException, Unit]

Attributes

Returns:

Effect which will sleep in non-blocking way for duration between current time and next run

def unsafeParse(cron: String): Cron

Attributes

Returns:

Cron instance, which corresponds to cron expression received as String or throws IllegalArgumentException if expression does not match cron definition

Concrete fields

val cronDefinition: CronDefinition
val cronParser: CronParser