service
service
¶
Shared helpers for the standalone serve() entry points.
The hub (terok_clearance.serve) and the
verdict helper (terok_clearance.verdict.server.serve)
both expose serve() coroutines that drive the standalone CLI
verbs (terok-clearance-hub serve / serve-verdict) used by
integration tests. Both need the same two pieces of plumbing: log
to stderr so the launching process picks it up, and block on
SIGINT / SIGTERM until the operator tears them down.
The per-container supervisor in terok-sandbox composes
ClearanceHub and
VerdictServer directly — it owns
its own lifecycle and signal handling, so it does not go through
these helpers.
configure_logging(level=logging.INFO)
¶
Send INFO-level logs to stderr so the launching process picks them up.
Source code in src/terok_clearance/runtime/service.py
wait_for_shutdown_signal()
async
¶
Block the current task until SIGINT or SIGTERM arrives.