# Class: Future

## vertx-js/future~ Future

#### new Future()

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

  Source:
    - future.js, line 30

### 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:
    - future.js, line 79

#### 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:
    - future.js, line 94

#### isComplete() → {boolean}

  Has the future completed?

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

  Source:
    - future.js, line 44

  ##### 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:
    - future.js, line 60