Class: Future

vertx-js/future~ Future

new Future()

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

Source:

Methods

complete(result)

Set the result. Any handler will be called, if there is one, and the future will be marked as completed.
Parameters:
Name Type Description
result Object the result
Source:

fail(failureMessage)

Set the failure. Any handler will be called, if there is one, and the future will be marked as completed.
Parameters:
Name Type Description
failureMessage string the failure message
Source:

isComplete() → {boolean}

Has the future completed?

It's completed if it's either succeeded or failed.

Source:
Returns:
true if completed, false if not
Type
boolean

setHandler(handler)

Set a handler for the result.

If the future has already been completed it will be called immediately. Otherwise it will be called when the future is completed.

Parameters:
Name Type Description
handler function the Handler that will be called with the result
Source: