Skip to content

v1.3.0

Choose a tag to compare

@benoitc benoitc released this 16 Feb 17:50

Added

  • Asyncio Support - New erlang.async_call() for asyncio-compatible callbacks
    • await erlang.async_call('func', arg1, arg2) - Call Erlang from async Python code
    • Integrates with asyncio event loop via add_reader()
    • No exceptions raised for control flow (unlike erlang.call())
    • Releases dirty NIF thread while waiting (non-blocking)
    • Works with FastAPI, Starlette, aiohttp, and other ASGI frameworks
    • Supports concurrent calls via asyncio.gather()

Fixed

  • Flag-based callback detection in replay path - Fixed SuspensionRequired exceptions leaking when ASGI middleware catches and re-raises exceptions

Changed

  • C code optimizations and refactoring
    • Thread safety fixes: Used pthread_once for async callback initialization
    • Timeout handling: Added read_with_timeout() and read_length_prefixed_data() helpers
    • Code deduplication: Merged suspended state creation functions, extracted helpers
    • Performance: Optimized list conversion using enif_make_list_cell()