# Class: HealthCheckHandler

## vertx-health-checks-js/health_check_handler~ HealthCheckHandler

#### new HealthCheckHandler()

A Vert.x Web handler on which you register health check procedure. It computes the outcome status (`UP` or `DOWN`) . When the handler process a HTTP request, it computes the global outcome and build a HTTP response as follows:

- 204 - status is `UP` but no procedures installed (no payload)
- 200 - status is `UP`, the payload contains the result of the installed procedures
- 503 - status is `DOWN`, the payload contains the result of the installed procedures
- 500 - status is `DOWN`, the payload contains the result of the installed procedures, one of the procedure has failed

Source:
  - vertx-health-checks-js/health_check_handler.js, line 44

### Methods

#### handle(arg0)

##### Parameters:

Name | Type | Description
--- | --- | ---
`arg0` | RoutingContext |

Source:
  - vertx-health-checks-js/health_check_handler.js, line 54

#### register(name, timeout, procedure) → {HealthCheckHandler}

Registers a health check procedure.

The procedure is a taking a of Status as parameter. Procedures are asynchronous, and must complete or fail the given . If the future object is failed, the procedure outcome is considered as `DOWN`. If the future is completed without any object, the procedure outcome is considered as `UP`. If the future is completed with a (not-null) Status, the procedure outcome is the received status.

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | string | the name of the procedure, must not be `null` or empty
`timeout` | number | the procedure timeout
`procedure` | function | the procedure, must not be `null`

Source:
  - vertx-health-checks-js/health_check_handler.js, line 76

##### Returns:

the current HealthCheckHandler

Type
  HealthCheckHandler

#### unregister(name) → {HealthCheckHandler}

Unregisters a procedure.

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | string | the name of the procedure

Source:
  - vertx-health-checks-js/health_check_handler.js, line 98

##### Returns:

the current HealthCheckHandler

Type
  HealthCheckHandler