Future

portals.util.Future
trait Future[T]

A future is a value that may be completed and available at a later time.

Futures are created by requesting a value from a portal. The value is completed by a corresponding reply from the portal. The await method registers a continuation on the future that is executed when the future is completed.

Type parameters

T

the type of the value

Attributes

Example
val future = ask(portal, request)
await(future) { future.value.get match
 case Rep(value) =>
   log.info(value.toString())
}
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def value: AskerTaskContext[_, _, _, T] ?=> Option[T]

The value of the future. If the future is not yet completed, the value is None. If the future is completed, the value is Some(value). Try using await instead to register a continuation for when the future is completed.

The value of the future. If the future is not yet completed, the value is None. If the future is completed, the value is Some(value). Try using await instead to register a continuation for when the future is completed.

Attributes

Returns

the optional value of the future

Concrete methods

override def toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any