Object/Trait

zio

Clock

Related Docs: trait Clock | package zio

Permalink

object Clock extends ClockPlatformSpecific with Serializable

Linear Supertypes
Serializable, Serializable, ClockPlatformSpecific, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Clock
  2. Serializable
  3. Serializable
  4. ClockPlatformSpecific
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. final case class ClockJava(clock: java.time.Clock) extends Clock with Product with Serializable

    Permalink

    An implementation of the Clock service backed by a java.time.Clock.

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. object ClockLive extends Clock

    Permalink
  5. val any: ZLayer[Clock, Nothing, Clock]

    Permalink
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def currentDateTime(implicit trace: ZTraceElement): URIO[Clock, OffsetDateTime]

    Permalink

    Get the current time, represented in the current timezone.

  9. def currentTime(unit: ⇒ TimeUnit)(implicit trace: ZTraceElement): URIO[Clock, Long]

    Permalink

    Returns the current time, relative to the Unix epoch.

  10. def driver[Env, In, Out](schedule: Schedule[Env, In, Out])(implicit trace: ZTraceElement): URIO[Clock, Driver[State, Env, In, Out]]

    Permalink
  11. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  15. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  16. def instant(implicit trace: ZTraceElement): ZIO[Clock, Nothing, Instant]

    Permalink
  17. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  18. val javaClock: ZLayer[java.time.Clock, Nothing, Clock]

    Permalink

    Constructs a Clock service from a java.time.Clock.

  19. val live: Layer[Nothing, Clock]

    Permalink
  20. def localDateTime(implicit trace: ZTraceElement): ZIO[Clock, Nothing, LocalDateTime]

    Permalink
  21. def nanoTime(implicit trace: ZTraceElement): URIO[Clock, Long]

    Permalink

    Returns the system nano time, which is not relative to any date.

  22. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  23. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  25. def repeat[R, R1 <: R, E, A, B](zio: ⇒ ZIO[R, E, A])(schedule: ⇒ Schedule[R1, A, B])(implicit trace: ZTraceElement): ZIO[R1 with Clock, E, B]

    Permalink

    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.

  26. final def repeatOrElse[R, R1 <: R, E, E2, A, B](zio: ⇒ ZIO[R, E, A])(schedule: ⇒ Schedule[R1, A, B], orElse: (E, Option[B]) ⇒ ZIO[R1, E2, B])(implicit trace: ZTraceElement): ZIO[R1 with Clock, E2, B]

    Permalink

    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.

  27. final def repeatOrElseEither[R, R1 <: R, E, E2, A, B, C](zio: ⇒ ZIO[R, E, A])(schedule: ⇒ Schedule[R1, A, B], orElse: (E, Option[B]) ⇒ ZIO[R1, E2, C])(implicit trace: ZTraceElement): ZIO[R1 with Clock, E2, Either[C, B]]

    Permalink

    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.

  28. final def retry[R, R1 <: R, E, A, S](zio: ⇒ ZIO[R, E, A])(policy: ⇒ Schedule[R1, E, S])(implicit ev: CanFail[E], trace: ZTraceElement): ZIO[R1 with Clock, E, A]

    Permalink

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

  29. final def retryOrElse[R, R1 <: R, E, E1, A, A1 >: A, S](zio: ⇒ ZIO[R, E, A])(policy: ⇒ Schedule[R1, E, S], orElse: (E, S) ⇒ ZIO[R1, E1, A1])(implicit ev: CanFail[E], trace: ZTraceElement): ZIO[R1 with Clock, E1, A1]

    Permalink

    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.

  30. final def retryOrElseEither[R, R1 <: R, E, E1, A, B, Out](zio: ⇒ ZIO[R, E, A])(schedule: ⇒ Schedule[R1, E, Out], orElse: (E, Out) ⇒ ZIO[R1, E1, B])(implicit ev: CanFail[E], trace: ZTraceElement): ZIO[R1 with Clock, E1, Either[B, A]]

    Permalink

    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.

  31. final def schedule[R, R1 <: R, E, A, B](zio: ⇒ ZIO[R, E, A])(schedule: ⇒ Schedule[R1, Any, B])(implicit trace: ZTraceElement): ZIO[R1 with Clock, E, B]

    Permalink

    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.

  32. final def scheduleFrom[R, R1 <: R, E, A, A1 >: A, B](zio: ⇒ ZIO[R, E, A])(a: ⇒ A1)(schedule: ⇒ Schedule[R1, A1, B])(implicit trace: ZTraceElement): ZIO[R1 with Clock, E, B]

    Permalink

    Runs this effect according to the specified schedule starting from the specified input value.

  33. def scheduler(implicit trace: ZTraceElement): URIO[Clock, Scheduler]

    Permalink

    Returns the scheduler used for scheduling effects.

  34. def sleep(duration: ⇒ zio.Duration)(implicit trace: ZTraceElement): URIO[Clock, Unit]

    Permalink

    Sleeps for the specified duration.

    Sleeps for the specified duration. This is always asynchronous.

  35. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  36. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  37. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from ClockPlatformSpecific

Inherited from AnyRef

Inherited from Any

Ungrouped