Services implement healthCheck() returning {status, detail, stale?}.
Status page refactored to use healthCheck() instead of ad-hoc checks.
Statuses: healthy, degraded (stale data), unhealthy (unreachable).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
19 lines
356 B
PHP
19 lines
356 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Mod\Chain\Contracts;
|
|
|
|
/**
|
|
* Service health check interface.
|
|
*
|
|
* $result = $service->healthCheck();
|
|
* if ($result['status'] === 'healthy') { ... }
|
|
*/
|
|
interface HealthCheckable
|
|
{
|
|
/**
|
|
* @return array{status: string, detail: string, stale?: bool}
|
|
*/
|
|
public function healthCheck(): array;
|
|
}
|