# Class: Async

## vertx-unit-js/async~ Async

#### new Async()

An asynchronous exit point for a test.

Source:
  - vertx-unit-js/async.js, line 31

### 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:
  - vertx-unit-js/async.js, line 116

#### 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:
  - vertx-unit-js/async.js, line 133

#### complete()

Signals the asynchronous operation is done, this method must be called with a count greater than `0`, otherwise it throws an `IllegalStateException` to signal the error.

Source:
  - vertx-unit-js/async.js, line 175

#### count() → {number}

Source:
  - vertx-unit-js/async.js, line 148

##### Returns:

the current count

Type
  number

#### countDown()

Count down the async.

Source:
  - vertx-unit-js/async.js, line 161

#### handler(completionHandler)

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

##### Parameters:

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

Source:
  - vertx-unit-js/async.js, line 95

#### isCompleted() → {boolean}

Source:
  - vertx-unit-js/async.js, line 56

##### Returns:

true if this completion is completed

Type
  boolean

#### isFailed() → {boolean}

Source:
  - vertx-unit-js/async.js, line 82

##### Returns:

true if the this completion is completed and failed

Type
  boolean

#### isSucceeded() → {boolean}

Source:
  - vertx-unit-js/async.js, line 69

##### Returns:

true if this completion is completed and succeeded

Type
  boolean

#### resolve(future)

Completes the future upon completion, otherwise fails it.

##### Parameters:

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

Source:
  - vertx-unit-js/async.js, line 43