Functions
build_health_response
3
tuple[int, list[tuple[by…
▼
Build a health check response.
When *draining* is True the response uses HTTP …
build_health_response
3
tuple[int, list[tuple[by…
▼
def build_health_response(*, worker_id: int, active_connections: int, draining: bool = False) -> tuple[int, list[tuple[bytes, bytes]], bytes]
Build a health check response.
When draining is True the response uses HTTP 503 with
{"status": "draining", ...}so load balancers stop routing
new traffic while the worker finishes in-flight work.
Parameters
| Name | Type | Description |
|---|---|---|
worker_id |
int |
|
active_connections |
int |
|
draining |
bool |
Default:False
|
Returns
tuple[int, list[tuple[bytes, bytes]], bytes]