Resolver

gears.async.Future.Resolver
trait Resolver[-T]

The group of handlers to be used in withResolver. As a Future is completed only once, only one of resolve/reject/complete may be used and only once.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def complete(result: Try[T]): Unit

Complete the future with the result, be it Success or Failure

Complete the future with the result, be it Success or Failure

Attributes

def onCancel(handler: () => Unit): Unit

Register a cancellation handler to be called when the created future is cancelled. Note that only one handler may be used. The handler should eventually complete the Future using one of complete/resolve/reject*. The default handler is set up to rejectAsCancelled immediately.

Register a cancellation handler to be called when the created future is cancelled. Note that only one handler may be used. The handler should eventually complete the Future using one of complete/resolve/reject*. The default handler is set up to rejectAsCancelled immediately.

Attributes

Concrete methods

def reject(exc: Throwable): Unit

Complete the future with a failure

Complete the future with a failure

Attributes

def rejectAsCancelled(): Unit

Complete the future with a CancellationException

Complete the future with a CancellationException

Attributes

def resolve(item: T): Unit

Complete the future with a data item successfully

Complete the future with a data item successfully

Attributes