Skip to content

granian

etrack.providers.adapters.server.granian

providers/adapters/server/granian: GranianAdapter — an ASGI app served by granian's embedded server, in-process.

granian's Rust runtime serves the app as a task of the host's own event loop: no second process, no thread of ours, no signal handler taken from the host. Opening starts the server and waits until its socket answers; closing stops it and waits for it to drain. The app is anything ASGI — the viewer's, or a host's own.

GranianAdapter

GranianAdapter(app: Asgi, **given: Unpack[GranianConfig])

One app on one address, served for as long as the adapter is open.

url property

url: str

Where the app answers: http://host:port.

health async

health() -> bool

Serving: the server's task still runs.