Async

libretto.util.Async$
See theAsync companion trait
object Async

Attributes

Companion:
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Async.type

Members list

Concise view

Type members

Classlikes

case class Later[A](register: (A => Unit) => Unit) extends Async[A]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Async[A]
class Object
trait Matchable
class Any
case class Now[A](value: A) extends Async[A]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Async[A]
class Object
trait Matchable
class Any

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def await[A](timeout: FiniteDuration)(a: Async[A]): Option[A]
def awaitAll(as: Seq[Async[_]]): Async[Unit]
def defer[A](a: => A): Async[A]
def fromFuture[A](fa: Future[A]): Async[Try[A]]
def later[A](register: (A => Unit) => Unit): Async[A]
def never[A]: Async[A]
def now[A](value: A): Async[A]
def promise[A]: (A => Boolean, Async[A])

Returns an Async[A] value and a completer function that will complete it. If the returned completer function is called more than once, the subsequent calls have no effect and return false. The returned Async can register multiple listeners.

Returns an Async[A] value and a completer function that will complete it. If the returned completer function is called more than once, the subsequent calls have no effect and return false. The returned Async can register multiple listeners.

Attributes

def promiseLinear[A]: (A => Unit, Async[A])

Returns an Async[A] value and a completer function that will complete it. The returned completer function must be called exactly once. An exception will be thrown on subsequent calls. The returned Async must register a listener exactly once. An exception will be thrown on subsequent listeners.

Returns an Async[A] value and a completer function that will complete it. The returned completer function must be called exactly once. An exception will be thrown on subsequent calls. The returned Async must register a listener exactly once. An exception will be thrown on subsequent listeners.

Attributes

def race[A, B](a: Async[A], b: Async[B]): Async[Either[A, B]]
def race_[A](a1: Async[A], a2: Async[A]): Async[A]
def toFuture[A](async: Async[A]): Future[A]