Skip to content

Releases

v0.2.1

Choose a tag to compare

@danog danog released this 26 Nov 12:08

fork() works again, also from inside a running loop: this fixes Psalm hanging with revolt-rs loaded.

  • fork() support is back (#4). 0.2.0 removed it (#3), but Psalm's worker pool forks from inside the running loop (amphp/parallel's ForkContext). On Linux, a child's first poll replayed a change the parent had queued at the fork on the parent's epoll instance, which is shared across fork(). That deleted the parent's IPC listener, and the parent then waited in epoll_wait forever. This hung about 10% of Psalm CI jobs. A forked child now gets its own poller, wait timer and signal wake pipe at its next poll, and never touches the parent's. ForkTest covers it, including a deterministic reproduction of the Psalm case.
  • Performance: the fork check is one relaxed atomic load per poll, inlined; the rebuild is out of line. Re-arming a registered source, enabling and disabling check nothing (before 0.2.0, every arm checked).
  • Development: rustfmt and clippy (-D warnings) run in CI on Linux, macOS and Windows; the code is formatted and clippy-clean.

Embedders (danog/mongo-php-async-driver) pick it up by its tag.

v0.2.0

Choose a tag to compare

@danog danog released this 20 Nov 13:08

PHP 8.6, and no more fork() support (hence 0.2.0).

  • PHP 8.6 (API 20261112): built with ext-php-rs-build 0.2.1 from crates.io, no more patched copy (#2). Tested, and released as binaries, on 8.6 everywhere, Windows included.
  • fork() is not supported (#3): a forked child must not use the loop, whose poller, wait timer and signal pipe are shared with the parent, or not inherited. The fork generation checks (and ForkTest) were removed: nothing embedding revolt-rs forks, and revolt/event-loop 1.1's own IoPollDriver isn't fork-safe either.

Embedders (danog/mongo-php-async-driver) pick it up by its tag.

v0.1.1

Choose a tag to compare

@danog danog released this 19 Nov 13:20

Fixes a heap use-after-free that corrupted PHP's allocator (zend_mm_heap corrupted, segfaults), reported in danog/AsyncOrm's CI through danog/mongo-php-async-driver, which embeds revolt-rs (#1).

A queued closure's arguments (EventLoop::queue($closure, ...$args)) were given to the call and still reported to the cycle collector as references of the callback fiber. Once the closure dropped an argument, a collection meanwhile visited the freed value (GC_DELREF on the allocator's free-list pointer); a live one was counted twice. Arguments given to the call are no longer reported (by-reference ones still are, as the call's frame refers to them). Regression test: GcTest::testQueuedArgumentDroppedBeforeCollection (reported by ASan before the fix).

Upgrading is recommended for everyone, the extension and embedders alike: any code using EventLoop::queue() (Amp's futures and suspensions do) could hit it.

v0.1.0

Choose a tag to compare

@danog danog released this 12 Nov 14:41

First release: revolt/event-loop 1.0.9 implemented natively in Rust as the revolt PHP extension. Code on Revolt (Amp v3, your own) runs unchanged on a native loop, 1.5–5× faster.

  • Same API: Reflection-identical to revolt/event-loop, whose own test suite passes unchanged. Differences, each pinned by a test, are in DIVERGENCES.md: one driver class, Driver\NativeDriver, and EventLoop::setDriver() throws.
  • Native reactor: epoll (Linux), kqueue (macOS), WSAPoll (Windows); no stream_select() limits, no ext-ev/event/uv, signals without ext-pcntl.
  • Embeddable: other Rust extensions can share the loop from Rust through a versioned ABI, see EMBEDDING.md.
  • PHP 8.2–8.6, NTS and ZTS, Linux, macOS, Windows. Composer: danog/revolt-rs provides revolt/event-loop 1.0.9.

Install with PIE:

pie install danog/revolt-rs

Pre-built binaries are attached below; where none matches, PIE builds from source (needs Rust and libclang).