Skip to content

Commit 9e651ee

Browse files
authored
Merge pull request #30 from benoitc/feature/py-buffer-docs
Add PyBuffer tests, documentation, and async I/O support
2 parents de998a3 + 04fa898 commit 9e651ee

14 files changed

Lines changed: 3110 additions & 2 deletions

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@
44

55
### Added
66

7+
- **PyBuffer API** - Zero-copy WSGI input buffer for streaming HTTP bodies
8+
- `py_buffer:new/0,1` - Create buffer (chunked or with content_length)
9+
- `py_buffer:write/2` - Append data, signals waiting Python readers
10+
- `py_buffer:close/1` - Signal EOF, wake all readers
11+
- Python `PyBuffer` type with file-like interface:
12+
- `read(size)`, `readline()`, `readlines()` - Blocking reads with GIL released
13+
- `read_nonblock(size)` - Non-blocking read for async I/O
14+
- `readable_amount()` - Bytes available without blocking
15+
- `at_eof()` - Check if at EOF with no more data
16+
- `seek(offset, whence)`, `tell()` - Position tracking
17+
- `find(sub)` - Fast substring search via memmem/memchr
18+
- `memoryview(buf)` - Zero-copy buffer protocol
19+
- `for line in buf:` - Line iteration
20+
- Auto-conversion: Passing buffer ref to `py:call`/`py:eval` wraps as `PyBuffer`
21+
- Suitable for `wsgi.input` in WSGI applications
22+
- See [Buffer API docs](docs/buffer.md)
23+
724
- **Inline Continuation API** - High-performance scheduling without Erlang messaging
825
- `erlang.schedule_inline(module, func, args, kwargs)` - Chain Python calls via `enif_schedule_nif()`
926
- ~3x faster than `schedule_py` for tight loops (bypasses gen_server messaging)

0 commit comments

Comments
 (0)