Ref

object Ref extends Serializable
Companion:
class
class Object
trait Matchable
class Any
Ref.type

Type members

Classlikes

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.

Companion:
object
Companion:
class
object unsafe

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.