# Class: Completion

## vertx-unit-js/completion~ Completion

#### new Completion()

  A completion object that emits completion notifications either succeeded or failed.
  Source:
    - completion.js, line 30

### Methods

#### await(timeoutMillis)

  Cause the current thread to wait until this completion completes with a configurable timeout.

  If completion times out or the current thread is interrupted, an exception will be thrown.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `timeoutMillis` | number | the timeout in milliseconds

  Source:
    - completion.js, line 117

#### awaitSuccess(timeoutMillis)

  Cause the current thread to wait until this completion completes and succeeds with a configurable timeout.

  If completion times out or the current thread is interrupted or the suite fails, an exception will be thrown.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `timeoutMillis` | number | the timeout in milliseconds

  Source:
    - completion.js, line 134

#### handler(completionHandler)

  Completion handler to receive a completion signal when this completions completes.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `completionHandler` | function | the completion handler

  Source:
    - completion.js, line 96

#### isCompleted() → {boolean}

  Source:
    - completion.js, line 55

  ##### Returns:

  - true if this completion is completed
  - Type
      boolean

#### isFailed() → {boolean}

  Source:
    - completion.js, line 83

  ##### Returns:

  - true if the this completion is completed and failed
  - Type
      boolean

#### isSucceeded() → {boolean}

  Source:
    - completion.js, line 69

  ##### Returns:

  - true if the this completion is completed succeeded
  - Type
      boolean

#### resolve(future)

  Completes the future upon completion, otherwise fails it.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `future` | Future | the future to resolve

  Source:
    - completion.js, line 41