Choosing a transport and migratingΒΆ
The packages share the wire protocol, route concepts and RPC API. Their WebSocket integration and lifecycle behavior differ.
Concern |
aiohttp |
ASGI |
|---|---|---|
Python namespace |
|
|
Server integration |
aiohttp route with handler class |
|
Connection metadata |
aiohttp |
ASGI scope or supplied framework WebSocket |
Python client transport |
aiohttp |
optional |
Binary hook input |
|
|
Async handler |
|
|
Threaded handler |
synchronous functions |
synchronous functions; coroutine handlers awaited normally |
Broadcast |
worker-local |
worker-local; isolated application registries available |
For existing aiohttp applications, start with the aiohttp guide. For FastAPI, Starlette and other asyncio ASGI applications, use the ASGI framework guide.
Migrating a server changes its transport integration and imports. Existing
clients can continue to use the same protocol. See the detailed
ASGI migration guide for constructor, exception, cleanup
and concurrency differences. Trio backends are not supported by wsrpc-asgi.
The documentation is published as one site, with shared protocol and client guides and separate transport-specific quick starts, API references and examples.