You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add erlang.async_call() for asyncio-compatible callbacks
Implements a new async API that integrates properly with asyncio without
raising exceptions for control flow. This is the recommended approach for
ASGI/asyncio applications (FastAPI, Starlette, etc).
Usage:
result = await erlang.async_call('func', arg1, arg2)
The implementation:
- Creates an asyncio Future for each call
- Sends request to Erlang via thread coordinator
- Releases the dirty NIF thread while waiting
- Uses a non-blocking pipe monitored by asyncio
- Resolves the Future when Erlang responds
This avoids the SuspensionRequired exception that conflicts with asyncio's
Task error handling when middleware catches and re-raises exceptions.
0 commit comments