object MockClock extends Serializable
- Alphabetic
- By Inheritance
- MockClock
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
case class
Data(nanoTime: Long, currentTimeMillis: Long, sleeps: List[(Duration, Promise[Nothing, Unit])], timeZone: ZoneId) extends Product with Serializable
The state of the
MockClock. - case class FiberData(nanoTime: Long) extends Product with Serializable
- case class Mock(clockState: Ref[Data], fiberState: FiberRef[FiberData]) extends Service[Any] with Product with Serializable
- trait Service[R] extends clock.Clock.Service[R] with scheduler.Scheduler.Service[R]
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
DefaultData: Data
The default initial state of the
MockClockwith the clock time set to0and no effects scheduled to run. -
def
adjust(duration: Duration): ZIO[MockClock, Nothing, Unit]
Accesses a
MockClockinstance in the environment and increments the time by the specified duration, running any actions scheduled for on or before the new time. -
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
make(data: Data): UIO[MockClock]
Constructs a new
MockClockwith the specified initial state.Constructs a new
MockClockwith the specified initial state. This can be useful for providing the required environment to an effect that requires aClock, such as with ZIO!.provide. -
def
makeMock(data: Data): UIO[Mock]
Constructs a new
Mockobject that implements theMockClockinterface.Constructs a new
Mockobject that implements theMockClockinterface. This can be useful for mixing in with implementations of other interfaces. -
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
setTime(duration: Duration): ZIO[MockClock, Nothing, Unit]
Accesses a
MockClockinstance in the environment and sets the clock time to the specified time, running any actions scheduled for on or before the new time. -
def
setTimeZone(zone: ZoneId): ZIO[MockClock, Nothing, Unit]
Accesses a
MockClockinstance in the environment, setting the time zone to the specified time zone.Accesses a
MockClockinstance in the environment, setting the time zone to the specified time zone. The clock time in terms of nanoseconds since the epoch will not be altered and no scheduled actions will be run as a result of this effect. -
val
sleeps: ZIO[MockClock, Nothing, List[Duration]]
Accesses a
MockClockinstance in the environment and returns a list of times that effects are scheduled to run. -
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
val
timeZone: ZIO[MockClock, Nothing, ZoneId]
Accesses a
MockClockinstance in the environemtn and returns the current time zone. -
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()