blackbull.server.multiworker¶
blackbull.server.multiworker
¶
Multi-worker master.
Workers inherit listeners, not a live event loop. Lifespan runs per worker; the master owns signals and supervision. Shared state is process-local.
MultiWorkerServer
¶
Spawns and supervises N worker processes.
Parameters¶
app:
ASGI application callable.
raw_sockets:
Pre-bound sockets that every worker will inherit.
ssl_context:
TLS context, or None for plain HTTP.
workers:
Number of worker processes to maintain.
max_connections:
Per-worker connection limit forwarded to ASGIServer.
shutdown_timeout:
Seconds to wait for graceful shutdown before sending SIGKILL.
run()
¶
Spawn workers and block until a shutdown signal is received.
When reload is enabled the master also runs a file watcher and
re-execs itself on any matching change — see
blackbull.server.reload.