Download the PHP package thesis/grpc-health without Composer
On this page you can find all versions of the php package thesis/grpc-health. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download thesis/grpc-health
More information about thesis/grpc-health
Files in thesis/grpc-health
Package grpc-health
Short Description Standard gRPC health checking protocol (grpc.health.v1) for thesis/grpc.
License MIT
Informations about the package grpc-health
thesis/grpc-health
An implementation of the standard gRPC Health Checking Protocol
(grpc.health.v1.Health) for thesis/grpc. It ships both sides of
the protocol:
- a server — a mutable health state you drive from your application, plus the gRPC service adapter
that serves
Check,ListandWatchfrom it; - a client — a thin prober over the generated client that returns a typed
ServingStatus, answersserving(), and turns theWatchstream into a callback with a closable handle.
An empty service name ('') always addresses the overall health of the server, as defined by the
protocol.
Contents
- Installation
- Server
- Client
Installation
Server
The health state lives in a single Watchdog. Register it once in your container and share it through
three narrow ports, each injected only where it is needed:
Reporter— application services report their own readiness (report());Lifecycle— operators drain the whole surface (shutdown()/resume());Monitor— the gRPCServeradapter reads statuses and subscribes to changes.
Application services depend on Health\Reporter — they never see gRPC — and report their own
readiness:
On shutdown, drain traffic through the Lifecycle: mark everything NOT_SERVING so load
balancers stop routing while in-flight work finishes:
In a DI container this is one singleton Watchdog aliased to whichever of Reporter, Lifecycle
and Monitor each consumer needs.
Client
Wrap the generated HealthClient to get typed statuses instead of raw protobuf:
watch() runs the Watch server stream in a background coroutine and calls your callback with the current
status and then on every change, until the returned handle is closed:
All versions of grpc-health with dependencies
amphp/amp Version ^3.1
amphp/pipeline Version ^1.2
thesis/googleapis-rpc-types Version ^0.3
thesis/grpc-client Version ^0.3
thesis/grpc-protocol Version ^0.3
thesis/grpc-server Version ^0.3
thesis/protobuf Version ^0.2
thesis/protoregistry Version ^0.1.2