Packages

  • package root
    Definition Classes
    root
  • package fs2
    Definition Classes
    root
  • package async

    Provides utilities for asynchronous computations.

    Provides utilities for asynchronous computations.

    Definition Classes
    fs2
  • package immutable

    Provides types which allow asynchronous reading (but not writing).

    Provides types which allow asynchronous reading (but not writing).

    Definition Classes
    async
  • package mutable

    Provides types which allow asynchronous reading and writing.

    Provides types which allow asynchronous reading and writing.

    Definition Classes
    async
  • Promise
  • Ref

final class Ref[F[_], A] extends AnyRef

An asynchronous, concurrent mutable reference.

Provides safe concurrent access and modification of its content, but no functionality for synchronisation, which is instead handled by Promise. For this reason, a Ref is always initialised to a value.

The implementation is nonblocking and lightweight, consisting essentially of a purely functional wrapper over an AtomicReference

Source
Ref.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Ref
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from Ref[F, A] to any2stringadd[Ref[F, A]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (Ref[F, A], B)
    Implicit
    This member is added by an implicit conversion from Ref[F, A] to ArrowAssoc[Ref[F, A]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. def access: F[(A, (A) ⇒ F[Boolean])]

    Obtains a snapshot of the current value, and a setter for updating it.

    Obtains a snapshot of the current value, and a setter for updating it. The setter may noop (in which case false is returned) if another concurrent call to access uses its setter first.

    Once it has noop'd or been used once, a setter never succeeds again.

    Satisfies: r.access.map(_._1) == r.get r.access.flatMap { case (v, setter) => setter(f(v)) } == r.tryModify(f).map(_.isDefined)

  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  9. def ensuring(cond: (Ref[F, A]) ⇒ Boolean, msg: ⇒ Any): Ref[F, A]
    Implicit
    This member is added by an implicit conversion from Ref[F, A] to Ensuring[Ref[F, A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: (Ref[F, A]) ⇒ Boolean): Ref[F, A]
    Implicit
    This member is added by an implicit conversion from Ref[F, A] to Ensuring[Ref[F, A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean, msg: ⇒ Any): Ref[F, A]
    Implicit
    This member is added by an implicit conversion from Ref[F, A] to Ensuring[Ref[F, A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. def ensuring(cond: Boolean): Ref[F, A]
    Implicit
    This member is added by an implicit conversion from Ref[F, A] to Ensuring[Ref[F, A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  15. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from Ref[F, A] to StringFormat[Ref[F, A]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  17. def get: F[A]

    Obtains the current value.

    Obtains the current value.

    Since Ref is always guaranteed to have a value, the returned action completes immediately after being bound.

  18. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  19. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  20. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  21. def modify(f: (A) ⇒ A): F[Change[A]]

    Like tryModify but does not complete until the update has been successfully made.

    Like tryModify but does not complete until the update has been successfully made.

    Satisfies: r.modify(_ => a).void == r.setSync(a)

  22. def modify2[B](f: (A) ⇒ (A, B)): F[(Change[A], B)]

    Like modify but allows returning a B along with the update.

  23. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  24. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  25. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  26. def setAsync(a: A): F[Unit]

    *Asynchronously* sets the current value to the a

    *Asynchronously* sets the current value to the a

    After the returned F[Unit] is bound, an update will eventually occur, setting the current value to a.

    Satisfies: r.setAsync(fa) == async.fork(r.setSync(a)) but it's significantly faster.

  27. def setSync(a: A): F[Unit]

    *Synchronously* sets the current value to a.

    *Synchronously* sets the current value to a.

    The returned action completes after the reference has been successfully set.

    Satisfies: r.setSync(fa) *> r.get == fa

  28. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  29. def toString(): String
    Definition Classes
    AnyRef → Any
  30. def tryModify(f: (A) ⇒ A): F[Option[Change[A]]]

    Attempts to modify the current value once, returning None if another concurrent modification completes between the time the variable is read and the time it is set.

  31. def tryModify2[B](f: (A) ⇒ (A, B)): F[Option[(Change[A], B)]]

    Like tryModify but allows returning a B along with the update.

  32. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  35. def [B](y: B): (Ref[F, A], B)
    Implicit
    This member is added by an implicit conversion from Ref[F, A] to ArrowAssoc[Ref[F, A]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from Ref[F, A] to any2stringadd[Ref[F, A]]

Inherited by implicit conversion StringFormat from Ref[F, A] to StringFormat[Ref[F, A]]

Inherited by implicit conversion Ensuring from Ref[F, A] to Ensuring[Ref[F, A]]

Inherited by implicit conversion ArrowAssoc from Ref[F, A] to ArrowAssoc[Ref[F, A]]

Ungrouped