The deferred class is the primary implementation of the Promise interface.

The promise is accessible using the promise attribute of the deferred.

The deferred can either be fulfilled or rejected via the Completable.fulfill() or Completable.reject() methods. Both methods accept an argument or a promise to the argument, allowing the deferred to react on a promise.

By: Julien Viet

no subtypes hierarchy

Deferred(ExecutionContext context = ...)
  • context = globalExecutionContext

    The current context

promiseSource Codeshared actual promise promise

The promise of this deferred.

Inherited Attributes
Attributes inherited from: Object
Attributes inherited from: Promised<Value>
fulfillSource Codeshared actual void fulfill(Value|Promise<Value> val)

Fulfills the promise with a value or a promise to the value.

rejectSource Codeshared actual void reject(Throwable reason)

Rejects the promise with a reason.

Inherited Methods
Methods inherited from: Object
Methods inherited from: Completable<Value>
Nested Classes
promiseSource Codeshared actual promise

The promise of this deferred.