7 Managed runtime
| (require loom/runtime) | package: loom |
Use start-runtime for an opt-in loopback listener with request admission, request IDs, HTTP metrics, health routes and bounded asynchronous logging. Use runtime-port and runtime-snapshot to inspect the runtime. runtime-stop! performs cooperative shutdown with a shared wait budget and returns false on timeout; retry from outside admitted handlers. It does not guarantee response delivery, own database resources or stop a separately managed WebSocket listener.
| (require loom/live-drain) | package: loom |
An optional live drain coordinates WebSocket admission and restart closure. Pass the same drain to the runtime and WebSocket server. Transport errors and blocked application handlers may delay completion.