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
package

Default

Methods

__construct

__construct() 

Creates an instance of the default implementation of the @see \io\vertx\jphp\ext\healthchecks\HealthCheckHandler.

create( $arg0,  $arg1 = null) : \io\vertx\jphp\ext\healthchecks\HealthCheckHandler
static

This function creates a new instance of @see \io\vertx\jphp\ext\healthchecks\HealthChecks.

param $vertx [Vertx] the Vert.x instance, must not be {@code null} create($vertx)

Creates an instance of the default implementation of the @see \io\vertx\jphp\ext\healthchecks\HealthCheckHandler. This function creates a new instance of @see \io\vertx\jphp\ext\healthchecks\HealthChecks.

param $vertx [Vertx] the Vert.x instance, must not be {@code null} param $provider [AuthProvider] the Authentication provider used to authenticate the HTTP request create($vertx, $provider)

Arguments

$arg0

Vertx

$arg1

AuthProvider

Response

\io\vertx\jphp\ext\healthchecks\HealthCheckHandler

the created instance

Creates an instance of the default implementation of the @see \io\vertx\jphp\ext\healthchecks\HealthCheckHandler.

createWithHealthChecks( $arg0,  $arg1 = null) : \io\vertx\jphp\ext\healthchecks\HealthCheckHandler
static

param $hc [HealthChecks] the health checks object to use createWithHealthChecks($hc)

Creates an instance of the default implementation of the @see \io\vertx\jphp\ext\healthchecks\HealthCheckHandler.

param $hc [HealthChecks] the health checks object to use, must not be {@code null} param $provider [AuthProvider] createWithHealthChecks($hc, $provider)

Arguments

$arg0

HealthChecks

$arg1

AuthProvider

Response

\io\vertx\jphp\ext\healthchecks\HealthCheckHandler

the created instance

Something has happened, so handle it.

handle( $arg0) : void

Arguments

$arg0

RoutingContext

Registers a health check procedure.

register( $arg0,  $arg1,  $arg2 = null) : $this

The procedure is a taking a of @see \io\vertx\jphp\ext\healthchecks\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) @see \io\vertx\jphp\ext\healthchecks\Status, the procedure outcome is the received status.

This method uses a 1s timeout. To configure the timeout use @see \io\vertx\jphp\ext\healthchecks\HealthCheckHandler::register. param $name [string] the name of the procedure, must not be {@code null} or empty param $procedure [callable] the procedure, must not be {@code null} register($name, $procedure) Registers a health check procedure.

The procedure is a taking a of @see \io\vertx\jphp\ext\healthchecks\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) @see \io\vertx\jphp\ext\healthchecks\Status, the procedure outcome is the received status. param $name [string] the name of the procedure, must not be {@code null} or empty param $timeout [integer] the procedure timeout param $procedure [callable] the procedure, must not be {@code null} register($name, $timeout, $procedure)

Arguments

$arg0

string

$arg1

callable | integer

$arg2

callable

Response

$this

the current {@link HealthCheckHandler}

Unregisters a procedure.

unregister( $arg0) : $this

Arguments

$arg0

string

Response

$this

the current {@link HealthCheckHandler}