fiber-interop

TrueAsync

TrueAsync is asynchronous PHP: coroutines (Async\spawn) on its own scheduler over libuv, in a PHP 8.6 build with the true_async extension. Its engine RFC is async_scheduler_abi. Its coroutines are not PHP Fibers.

TrueAsync project site · adapter: fiber-interop/trueasync

composer require fiber-interop/trueasync

Conformance and test status

Conformance examples (of 25)25/25
Adapter unit testsAdapter unit tests pass in the trueasync/php-true-async Docker image
CIThe conformance numbers come from the site's daily CI run (conformance.json, PHP 8.6.0-dev, 2026-11-11), inside the trueasync/php-true-async Docker image
SkippedNone in the conformance suite

Differences

Requires PHP 8.6 built with TrueAsync and ext true_async 0.10+ (tested on 0.10.0, ABI v0.26.0), for example the Docker image trueasync/php-true-async:latest. Mapping: go is Async\spawn, await is Async\await with Async\timeout, sleep is Async\delay, readable/writable use stream_select(). Differences from the other adapters: children started with native Async\spawn do not join the creator's Scope, because there is no spawn hook (started through fiber\go() they do); fclose() does not wake a stream_select() waiting on that stream, so the adapter polls in 20 ms slices; stream_select timeouts below 1 ms are rounded up to 1 ms; an unawaited failing coroutine ends the script, so the adapter keeps task failures inside the task.

Beyond the contract

Fully conformant (25/25). Scope follows tasks started with fiber\go(); coroutines started with Async\spawn() don't inherit it. A spawn hook in TrueAsync, run when a coroutine is created, would let raw Async\spawn children inherit the creator's Scope. A stream_select() woken by fclose() on a watched stream would remove the 20 ms polling. Nothing else is documented.

All runtimes · Conformance matrix