Class/Object

fs2.async

Ref

Related Docs: object Ref | package async

Permalink

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    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)

    Permalink
    Implicit information
    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

    Permalink
    Definition Classes
    AnyRef → Any
  6. def access: F[(A, (A) ⇒ F[Boolean])]

    Permalink

    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

    Permalink
    Definition Classes
    Any
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def ensuring(cond: (Ref[F, A]) ⇒ Boolean, msg: ⇒ Any): Ref[F, A]

    Permalink
    Implicit information
    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]

    Permalink
    Implicit information
    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]

    Permalink
    Implicit information
    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]

    Permalink
    Implicit information
    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

    Permalink
    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  15. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    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]

    Permalink

    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[_]

    Permalink
    Definition Classes
    AnyRef → Any
  19. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  20. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  21. def modify(f: (A) ⇒ A): F[Change[A]]

    Permalink

    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)]

    Permalink

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

  23. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  24. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  25. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  26. def setAsync(a: A): F[Unit]

    Permalink

    *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]

    Permalink

    *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

    Permalink
    Definition Classes
    AnyRef
  29. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  30. def tryModify(f: (A) ⇒ A): F[Option[Change[A]]]

    Permalink

    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)]]

    Permalink

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

  32. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. def [B](y: B): (Ref[F, A], B)

    Permalink
    Implicit information
    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