Class: Promise

vertx-js/promise~ Promise

new Promise()

Represents the writable side of an action that may, or may not, have occurred yet.

Source:

Methods

complete()

Calls complete(null)
Source:

fail(message)

Calls Promise#fail with the message.
Parameters:
Name Type Description
message string the failure message
Source:

future() → {Future}

Source:
Returns:
the Future associated with this promise, it can be used to be aware of the promise completion
Type
Future

tryComplete() → {boolean}

Calls tryComplete(null).
Source:
Returns:
false when the future is already completed
Type
boolean

tryFail(message) → {boolean}

Calls Promise#fail with the message.
Parameters:
Name Type Description
message string the failure message
Source:
Returns:
false when the future is already completed
Type
boolean