object Clock extends ClockPlatformSpecific with Serializable
- Alphabetic
- By Inheritance
- Clock
- Serializable
- ClockPlatformSpecific
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- final case class ClockJava(clock: java.time.Clock) extends Clock with Product with Serializable
An implementation of the
Clockservice backed by ajava.time.Clock.
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
- val any: ZLayer[Has[Clock], Nothing, Has[Clock]]
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- val currentDateTime: URIO[Has[Clock], OffsetDateTime]
Get the current time, represented in the current timezone.
- def currentTime(unit: => TimeUnit): URIO[Has[Clock], Long]
Returns the current time, relative to the Unix epoch.
- def driver[Env, In, Out](schedule: Schedule[Env, In, Out]): URIO[Has[Clock], Driver[State, Env, In, Out]]
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- val instant: ZIO[Has[Clock], Nothing, Instant]
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val javaClock: ZLayer[Has[java.time.Clock], Nothing, Has[Clock]]
Constructs a
Clockservice from ajava.time.Clock. - val live: Layer[Nothing, Has[Clock]]
- val nanoTime: URIO[Has[Clock], Long]
Returns the system nano time, which is not relative to any date.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def repeat[R, R1 <: R, E, A, B](zio: => ZIO[R, E, A])(schedule: => Schedule[R1, A, B]): ZIO[R1 with Has[Clock], E, B]
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 executesio, and then if that succeeds, executesioan additional time. - 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]): ZIO[R1 with Has[Clock], E2, B]
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 executesio, and then if that succeeds, executesioan additional time. - 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]): ZIO[R1 with Has[Clock], E2, Either[C, B]]
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 executesio, and then if that succeeds, executesioan additional time. - final def retry[R, R1 <: R, E, A, S](zio: => ZIO[R, E, A])(policy: => Schedule[R1, E, S])(implicit ev: CanFail[E]): ZIO[R1 with Has[Clock], E, A]
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 withonceorrecursfor example), so that thatio.retry(Schedule.once)means "executeioand in case of failure, try again once". - 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]): ZIO[R1 with Has[Clock], E1, A1]
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.
- 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]): ZIO[R1 with Has[Clock], E1, Either[B, A]]
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.
- final def schedule[R, R1 <: R, E, A, B](zio: => ZIO[R, E, A])(schedule: => Schedule[R1, Any, B]): ZIO[R1 with Has[Clock], E, B]
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.
- final def scheduleFrom[R, R1 <: R, E, A, A1 >: A, B](zio: => ZIO[R, E, A])(a: => A1)(schedule: => Schedule[R1, A1, B]): ZIO[R1 with Has[Clock], E, B]
Runs this effect according to the specified schedule starting from the specified input value.
- def sleep(duration: => zio.Duration): URIO[Has[Clock], Unit]
Sleeps for the specified duration.
Sleeps for the specified duration. This is always asynchronous.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- 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()
- object ClockLive extends Clock