Commit 9150564
authored
Add handle-based Python C API for per-loop isolation (#5)
Add isolated event loops with `ErlangEventLoop(isolated=True)`
Each isolated loop has its own pending queue for full callback isolation.
Full asyncio support (timers, FD operations) via shared router.
Useful for multi-threaded Python, sub-interpreters, and free-threaded Python (3.13+).
Implementation:
- Add `isolated=False` parameter to `ErlangEventLoop.__init__`
- Add handle-based Python C API (`_loop_new`, `_run_once_native_for`, etc.)
- Add shared router for per-loop created loops (`set_shared_router` NIF)
- Timer messages include LoopRef for correct dispatch to isolated loops
- Router stores LoopRef with each timer, dispatches to correct loop
See `docs/asyncio.md` for usage and architecture details.1 parent 7326786 commit 9150564
11 files changed
Lines changed: 1784 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
21 | 27 | | |
22 | 28 | | |
23 | 29 | | |
| |||
0 commit comments