Nexus API Reference

HealthCheckHandler
in package

Read onlyYes
FinalYes
Tags
psalm-api

Invokable handler — register against a route to serve the aggregate health endpoint:

$registry = (new HealthCheckRegistry()) ->add(new DatabaseHealthCheck($pdo)) ->add(new RedisHealthCheck($redis));

$app->get('/health', new HealthCheckHandler($registry));

Response shape (RFC-health-json-inspired):

200 OK (everything up or degraded) 503 (any check is down)

{ "status": "up" | "degraded" | "down", "checks": { "database": {"state": "up", "detail": {"latencyMs": 1.2}}, "redis": {"state": "down", "detail": {"error": "connection refused"}} } }

A check that THROWS is treated as down; the exception class becomes the error detail. The handler itself never throws.

Table of Contents

Methods

__construct()  : mixed
__invoke()  : ResponseInterface

Methods

__invoke()

public __invoke() : ResponseInterface
Return values
ResponseInterface

        
On this page

Search results