Ref

zio.Ref
See theRef companion class
object Ref extends Serializable

Attributes

Companion
class
Source
Ref.scala
Graph
Supertypes
trait Serializable
class Object
trait Matchable
class Any
Self type
Ref.type

Members list

Type members

Classlikes

sealed abstract class Synchronized[A] extends Ref[A]

A Ref.Synchronized is a purely functional description of a mutable reference. The fundamental operations of a Ref.Synchronized are set and get. set sets the reference to a new value. get gets the current value of the reference.

A Ref.Synchronized is a purely functional description of a mutable reference. The fundamental operations of a Ref.Synchronized are set and get. set sets the reference to a new value. get gets the current value of the reference.

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

Attributes

Companion
object
Source
Ref.scala
Supertypes
class Ref[A]
trait Serializable
class Object
trait Matchable
class Any
object Synchronized

Attributes

Companion
class
Source
Ref.scala
Supertypes
class Object
trait Matchable
class Any
Self type
object unsafe

Attributes

Source
Ref.scala
Supertypes
class Object
trait Matchable
class Any
Self type
unsafe.type

Value members

Concrete methods

def make[A](a: => A)(implicit trace: Trace): UIO[Ref[A]]

Creates a new Ref with the specified value.

Creates a new Ref with the specified value.

Attributes

Source
Ref.scala