Packages

sealed abstract class Synchronized[-RA, -RB, +EA, +EB, -A, +B] extends ZRef[RA, RB, EA, EB, A, B]

A ZRef.Synchronized[RA, RB, EA, EB, A, B] is a polymorphic, purely functional description of a mutable reference. The fundamental operations of a ZRef.Synchronized are set and get. set takes a value of type A and sets the reference to a new value, requiring an environment of type RA and potentially failing with an error of type EA. get gets the current value of the reference and returns a value of type B, requiring an environment of type RB and potentially failing with an error of type EB.

When the error and value types of the ZRef.Synchronized are unified, that is, it is a ZRef.Synchronized[R, R, E, E, A, A], the ZRef.Synchronized also supports atomic modify and update operations.

Unlike an ordinary ZRef, a ZRef.Synchronized allows performing effects within update operations, at some cost to performance. Writes will semantically block other writers, while multiple readers can read simultaneously.

ZRef.Synchronized also supports composing multiple ZRef.Synchronized values together to form a single ZRef.Synchronized value that can be atomically updated using the zip operator. In this case reads and writes will semantically block other readers and writers.

Self Type
Synchronized[RA, RB, EA, EB, A, B]
Linear Supertypes
ZRef[RA, RB, EA, EB, A, B], Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Synchronized
  2. ZRef
  3. Serializable
  4. Serializable
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def semaphores: Set[Semaphore]
    Attributes
    protected
  2. abstract def unsafeGet(implicit trace: ZTraceElement): ZIO[RB, EB, B]
    Attributes
    protected
  3. abstract def unsafeSet(a: A)(implicit trace: ZTraceElement): ZIO[RA, EA, Unit]
    Attributes
    protected
  4. abstract def unsafeSetAsync(a: A)(implicit trace: ZTraceElement): ZIO[RA, EA, Unit]
    Attributes
    protected

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  6. final def collect[C](pf: PartialFunction[B, C]): Synchronized[RA, RB, EA, Option[EB], A, C]

    Maps and filters the get value of the ZRefM with the specified partial function, returning a ZRefM with a get value that succeeds with the result of the partial function if it is defined or else fails with None.

    Maps and filters the get value of the ZRefM with the specified partial function, returning a ZRefM with a get value that succeeds with the result of the partial function if it is defined or else fails with None.

    Definition Classes
    SynchronizedZRef
  7. final def collectZIO[RC <: RB, EC >: EB, C](pf: PartialFunction[B, ZIO[RC, EC, C]]): Synchronized[RA, RC, EA, Option[EC], A, C]

    Maps and filters the get value of the ZRef.Synchronized with the specified effectual partial function, returning a ZRef.Synchronized with a get value that succeeds with the result of the partial function if it is defined or else fails with None.

  8. final def contramap[C](f: (C) ⇒ A): Synchronized[RA, RB, EA, EB, C, B]

    Transforms the set value of the ZRef.Synchronized with the specified function.

    Transforms the set value of the ZRef.Synchronized with the specified function.

    Definition Classes
    SynchronizedZRef
  9. final def contramapEither[EC >: EA, C](f: (C) ⇒ Either[EC, A]): Synchronized[RA, RB, EC, EB, C, B]

    Transforms the set value of the ZRef with the specified fallible function.

    Transforms the set value of the ZRef with the specified fallible function.

    Definition Classes
    SynchronizedZRef
  10. final def contramapZIO[RC <: RA, EC >: EA, C](f: (C) ⇒ ZIO[RC, EC, A]): Synchronized[RC, RB, EC, EB, C, B]

    Transforms the set value of the ZRef.Synchronized with the specified effectual function.

  11. final def dimap[C, D](f: (C) ⇒ A, g: (B) ⇒ D): Synchronized[RA, RB, EA, EB, C, D]

    Transforms both the set and get values of the ZRef.Synchronized with the specified functions.

    Transforms both the set and get values of the ZRef.Synchronized with the specified functions.

    Definition Classes
    SynchronizedZRef
  12. final def dimapEither[EC >: EA, ED >: EB, C, D](f: (C) ⇒ Either[EC, A], g: (B) ⇒ Either[ED, D]): Synchronized[RA, RB, EC, ED, C, D]

    Transforms both the set and get values of the ZRef with the specified fallible functions.

    Transforms both the set and get values of the ZRef with the specified fallible functions.

    Definition Classes
    SynchronizedZRef
  13. final def dimapError[EC, ED](f: (EA) ⇒ EC, g: (EB) ⇒ ED): Synchronized[RA, RB, EC, ED, A, B]

    Transforms both the set and get errors of the ZRef.Synchronized with the specified functions.

    Transforms both the set and get errors of the ZRef.Synchronized with the specified functions.

    Definition Classes
    SynchronizedZRef
  14. final def dimapZIO[RC <: RA, RD <: RB, EC >: EA, ED >: EB, C, D](f: (C) ⇒ ZIO[RC, EC, A], g: (B) ⇒ ZIO[RD, ED, D]): Synchronized[RC, RD, EC, ED, C, D]

    Transforms both the set and get values of the ZRef.Synchronized with the specified effectual functions.

  15. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  17. final def filterInput[A1 <: A](f: (A1) ⇒ Boolean): Synchronized[RA, RB, Option[EA], EB, A1, B]

    Filters the set value of the ZRef.Synchronized with the specified predicate, returning a ZRef.Synchronized with a set value that succeeds if the predicate is satisfied or else fails with None.

    Filters the set value of the ZRef.Synchronized with the specified predicate, returning a ZRef.Synchronized with a set value that succeeds if the predicate is satisfied or else fails with None.

    Definition Classes
    SynchronizedZRef
  18. final def filterInputZIO[RC <: RA, EC >: EA, A1 <: A](f: (A1) ⇒ ZIO[RC, EC, Boolean]): Synchronized[RC, RB, Option[EC], EB, A1, B]

    Filters the set value of the ZRef.Synchronized with the specified effectual predicate, returning a ZRef.Synchronized with a set value that succeeds if the predicate is satisfied or else fails with None.

  19. final def filterOutput(f: (B) ⇒ Boolean): Synchronized[RA, RB, EA, Option[EB], A, B]

    Filters the get value of the ZRef.Synchronized with the specified predicate, returning a ZRef.Synchronized with a get value that succeeds if the predicate is satisfied or else fails with None.

    Filters the get value of the ZRef.Synchronized with the specified predicate, returning a ZRef.Synchronized with a get value that succeeds if the predicate is satisfied or else fails with None.

    Definition Classes
    SynchronizedZRef
  20. final def filterOutputZIO[RC <: RB, EC >: EB](f: (B) ⇒ ZIO[RC, EC, Boolean]): Synchronized[RA, RC, EA, Option[EC], A, B]

    Filters the get value of the ZRef.Synchronized with the specified effectual predicate, returning a ZRef.Synchronized with a get value that succeeds if the predicate is satisfied or else fails with None.

  21. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  22. final def fold[EC, ED, C, D](ea: (EA) ⇒ EC, eb: (EB) ⇒ ED, ca: (C) ⇒ Either[EC, A], bd: (B) ⇒ Either[ED, D]): Synchronized[RA, RB, EC, ED, C, D]

    Folds over the error and value types of the ZRef.Synchronized.

    Folds over the error and value types of the ZRef.Synchronized.

    Definition Classes
    SynchronizedZRef
  23. final def foldAll[EC, ED, C, D](ea: (EA) ⇒ EC, eb: (EB) ⇒ ED, ec: (EB) ⇒ EC, ca: (C) ⇒ (B) ⇒ Either[EC, A], bd: (B) ⇒ Either[ED, D]): Synchronized[RA with RB, RB, EC, ED, C, D]

    Folds over the error and value types of the ZRef.Synchronized, allowing access to the state in transforming the set value but requiring unifying the error type.

    Folds over the error and value types of the ZRef.Synchronized, allowing access to the state in transforming the set value but requiring unifying the error type.

    Definition Classes
    SynchronizedZRef
  24. final def foldAllZIO[RC <: RA with RB, RD <: RB, EC, ED, C, D](ea: (EA) ⇒ EC, eb: (EB) ⇒ ED, ec: (EB) ⇒ EC, ca: (C) ⇒ (B) ⇒ ZIO[RC, EC, A], bd: (B) ⇒ ZIO[RD, ED, D]): Synchronized[RC, RD, EC, ED, C, D]

    Folds over the error and value types of the ZRef.Synchronized, allowing access to the state in transforming the set value.

    Folds over the error and value types of the ZRef.Synchronized, allowing access to the state in transforming the set value. This is a more powerful version of foldZIO but requires unifying the environment and error types.

  25. final def foldZIO[RC <: RA, RD <: RB, EC, ED, C, D](ea: (EA) ⇒ EC, eb: (EB) ⇒ ED, ca: (C) ⇒ ZIO[RC, EC, A], bd: (B) ⇒ ZIO[RD, ED, D]): Synchronized[RC, RD, EC, ED, C, D]

    Folds over the error and value types of the ZRef.Synchronized.

    Folds over the error and value types of the ZRef.Synchronized. This is a highly polymorphic method that is capable of arbitrarily transforming the error and value types of the ZRef.Synchronized. For most use cases one of the more specific combinators implemented in terms of foldZIO will be more ergonomic but this method is extremely useful for implementing new combinators.

  26. final def get(implicit trace: ZTraceElement): ZIO[RB, EB, B]

    Reads the value from the ZRef.

    Reads the value from the ZRef.

    Definition Classes
    SynchronizedZRef
  27. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  28. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  29. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  30. final def map[C](f: (B) ⇒ C): Synchronized[RA, RB, EA, EB, A, C]

    Transforms the get value of the ZRef.Synchronized with the specified function.

    Transforms the get value of the ZRef.Synchronized with the specified function.

    Definition Classes
    SynchronizedZRef
  31. final def mapEither[EC >: EB, C](f: (B) ⇒ Either[EC, C]): Synchronized[RA, RB, EA, EC, A, C]

    Transforms the get value of the ZRef with the specified fallible function.

    Transforms the get value of the ZRef with the specified fallible function.

    Definition Classes
    SynchronizedZRef
  32. final def mapZIO[RC <: RB, EC >: EB, C](f: (B) ⇒ ZIO[RC, EC, C]): Synchronized[RA, RC, EA, EC, A, C]

    Transforms the get value of the ZRef.Synchronized with the specified effectual function.

  33. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  34. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  35. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  36. final def readOnly: Synchronized[RA, RB, EA, EB, Nothing, B]

    Returns a read only view of the ZRef.Synchronized.

    Returns a read only view of the ZRef.Synchronized.

    Definition Classes
    SynchronizedZRef
  37. final def set(a: A)(implicit trace: ZTraceElement): ZIO[RA, EA, Unit]

    Writes a new value to the ZRef, with a guarantee of immediate consistency (at some cost to performance).

    Writes a new value to the ZRef, with a guarantee of immediate consistency (at some cost to performance).

    Definition Classes
    SynchronizedZRef
  38. final def setAsync(a: A)(implicit trace: ZTraceElement): ZIO[RA, EA, Unit]

    Writes a new value to the ZRef without providing a guarantee of immediate consistency.

    Writes a new value to the ZRef without providing a guarantee of immediate consistency.

    Definition Classes
    SynchronizedZRef
  39. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  40. final def tapInput[RC <: RA, EC >: EA, A1 <: A](f: (A1) ⇒ ZIO[RC, EC, Any])(implicit trace: ZTraceElement): Synchronized[RC, RB, EC, EB, A1, B]

    Performs the specified effect every time a value is written to this ZRef.Synchronized.

  41. final def tapOutput[RC <: RB, EC >: EB](f: (B) ⇒ ZIO[RC, EC, Any])(implicit trace: ZTraceElement): Synchronized[RA, RC, EA, EC, A, B]

    Performs the specified effect very time a value is read from this ZRef.Synchronized.

  42. def toString(): String
    Definition Classes
    AnyRef → Any
  43. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  45. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  46. final def writeOnly: Synchronized[RA, RB, EA, Unit, A, Nothing]

    Returns a write only view of the ZRef.Synchronized.

    Returns a write only view of the ZRef.Synchronized.

    Definition Classes
    SynchronizedZRef

Deprecated Value Members

  1. final def collectM[RC <: RB, EC >: EB, C](pf: PartialFunction[B, ZIO[RC, EC, C]]): ZRefM[RA, RC, EA, Option[EC], A, C]

    Maps and filters the get value of the ZRefM with the specified effectual partial function, returning a ZRefM with a get value that succeeds with the result of the partial function if it is defined or else fails with None.

    Maps and filters the get value of the ZRefM with the specified effectual partial function, returning a ZRefM with a get value that succeeds with the result of the partial function if it is defined or else fails with None.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use collectZIO

  2. final def contramapM[RC <: RA, EC >: EA, C](f: (C) ⇒ ZIO[RC, EC, A])(implicit trace: ZTraceElement): ZRefM[RC, RB, EC, EB, C, B]

    Transforms the set value of the ZRefM with the specified effectual function.

    Transforms the set value of the ZRefM with the specified effectual function.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use contramapZIO

  3. final def dimapM[RC <: RA, RD <: RB, EC >: EA, ED >: EB, C, D](f: (C) ⇒ ZIO[RC, EC, A], g: (B) ⇒ ZIO[RD, ED, D]): ZRefM[RC, RD, EC, ED, C, D]

    Transforms both the set and get values of the ZRefM with the specified effectual functions.

    Transforms both the set and get values of the ZRefM with the specified effectual functions.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use dimapZIO

  4. final def filterInputM[RC <: RA, EC >: EA, A1 <: A](f: (A1) ⇒ ZIO[RC, EC, Boolean]): ZRefM[RC, RB, Option[EC], EB, A1, B]

    Filters the set value of the ZRefM with the specified effectual predicate, returning a ZRefM with a set value that succeeds if the predicate is satisfied or else fails with None.

    Filters the set value of the ZRefM with the specified effectual predicate, returning a ZRefM with a set value that succeeds if the predicate is satisfied or else fails with None.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use filterInputZIO

  5. final def filterOutputM[RC <: RB, EC >: EB](f: (B) ⇒ ZIO[RC, EC, Boolean]): ZRefM[RA, RC, EA, Option[EC], A, B]

    Filters the get value of the ZRefM with the specified effectual predicate, returning a ZRefM with a get value that succeeds if the predicate is satisfied or else fails with None.

    Filters the get value of the ZRefM with the specified effectual predicate, returning a ZRefM with a get value that succeeds if the predicate is satisfied or else fails with None.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use filterOutputZIO

  6. final def foldAllM[RC <: RA with RB, RD <: RB, EC, ED, C, D](ea: (EA) ⇒ EC, eb: (EB) ⇒ ED, ec: (EB) ⇒ EC, ca: (C) ⇒ (B) ⇒ ZIO[RC, EC, A], bd: (B) ⇒ ZIO[RD, ED, D]): ZRefM[RC, RD, EC, ED, C, D]

    Folds over the error and value types of the ZRefM, allowing access to the state in transforming the set value.

    Folds over the error and value types of the ZRefM, allowing access to the state in transforming the set value. This is a more powerful version of foldM but requires unifying the environment and error types.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use foldAllZIO

  7. final def foldM[RC <: RA, RD <: RB, EC, ED, C, D](ea: (EA) ⇒ EC, eb: (EB) ⇒ ED, ca: (C) ⇒ ZIO[RC, EC, A], bd: (B) ⇒ ZIO[RD, ED, D]): ZRefM[RC, RD, EC, ED, C, D]

    Folds over the error and value types of the ZRefM.

    Folds over the error and value types of the ZRefM. This is a highly polymorphic method that is capable of arbitrarily transforming the error and value types of the ZRefM. For most use cases one of the more specific combinators implemented in terms of foldM will be more ergonomic but this method is extremely useful for implementing new combinators.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use foldZIO

  8. final def mapM[RC <: RB, EC >: EB, C](f: (B) ⇒ ZIO[RC, EC, C])(implicit trace: ZTraceElement): ZRefM[RA, RC, EA, EC, A, C]

    Transforms the get value of the ZRefM with the specified effectual function.

    Transforms the get value of the ZRefM with the specified effectual function.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use mapZIO

Inherited from ZRef[RA, RB, EA, EB, A, B]

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped