(Anonymous)

A container for methods of Deferreds.

Documentation

A container for methods of Deferreds.

Properties

Data Fields

get _listeners

An array of visitors providing functions to be ran when the deferred's state changes.

Abstract
get _state

The current state of the deferred, as an ExecutionState.

Abstract

Debugging

inspect()

Returns a textual description of the object.

toString()

Returns a textual description of the object.

Extracting Values

future()

Retrieves the value of a deferred as a Future.

promise()

Retrieves the value of a deferred as a Promise. Cancellations are mapped to a rejected promise with a special object.

Reacting to Deferreds

listen(pattern)

Adds a visitor to be invoked when the deferred's state changes.

Resolving

cancel()

Resolves a deferred with a cancellation value.

maybeCancel()

Resolves a deferred with a cancellation value, but doesn't throw if the deferred has already been resolved.

reject(reason)

Resolves a deferred with a failure value.

resolve(value)

Resolves a deferred successfully with a value.

Authors
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)