TryableDeferred

abstract class TryableDeferred[F[_], A] extends Deferred[F, A]
class Deferred[F, A]
class Object
trait Matchable
class Any

Value members

Abstract methods

def tryGet: F[Option[A]]

Obtains the current value of the Deferred, or None if it hasn't completed.

Obtains the current value of the Deferred, or None if it hasn't completed.

Inherited methods

def complete(a: A): F[Unit]

If this Deferred is empty, sets the current value to a, and notifies any and all readers currently blocked on a get.

If this Deferred is empty, sets the current value to a, and notifies any and all readers currently blocked on a get.

Note that the returned action may complete after the reference has been successfully set: use F.start(r.complete) if you want asynchronous behaviour.

If this Deferred has already been completed, the returned action immediately fails with an IllegalStateException. In the uncommon scenario where this behavior is problematic, you can handle failure explicitly using attempt or any other ApplicativeError/MonadError combinator on the returned action.

Satisfies: Deferred[F, A].flatMap(r => r.complete(a) *> r.get) == a.pure[F]

Inherited from
Deferred
def get: F[A]

Obtains the value of the Deferred, or waits until it has been completed. The returned value may be canceled.

Obtains the value of the Deferred, or waits until it has been completed. The returned value may be canceled.

Inherited from
Deferred
def mapK[G[_]](f: FunctionK[F, G]): Deferred[G, A]

Modify the context F using transformation f.

Modify the context F using transformation f.

Inherited from
Deferred