⚡
#TrueAsync is an experimental library bringing true asynchronous programming to
#PHP — coroutines, async/await, and non-blocking I/O built into the language core. Write high-performance concurrent applications with clean, readable code and minimal changes.
#opensource #devtools
🌀 Lightweight coroutines for efficient concurrent execution. No colored async functions — just call spawn() and go.
🔌 Non-blocking I/O for regular
#PHP functions. fread, fwrite, file_get_contents, ob_start, curl,
#MySQL, and
#PostgreSQL now work asynchronously without extra effort.
🖥️ Built-in TrueAsync Server: a native HTTP/1.1, HTTP/2, and HTTP/3 web server written in C, running directly inside the
#PHP process.
🛑 Cooperative cancellation with a simple, flexible API for coroutine cancellation via Scope::cancel().
📦 Structured concurrency — control coroutine lifetime with the Scope sandbox and manage groups of coroutines via TaskGroup.
🗄️ PDO Pool: connection pooling built right into PDO with automatic connection management for maximum performance.
🔄 Channels & ThreadPool for data exchange between coroutines. Buffered and unbuffered channels for producer/consumer patterns, cross-thread via ThreadChannel, and parallel CPU tasks via Thread and ThreadPool.
🎯 Futures deliver deferred results for async computations, with composition via await_all and await_first. Context associates data with a coroutine for easy adaptation of global-variable code.
🗓️ Roadmap: Complete Async API (v0.6) shipped March 2026, with Threads & Stabilization in Summer 2026, Framework Adapters in Q3 2026, and a stable v1.0 release targeted for November 2026 on PHP 8.6.
🌐
true-async.github.io/en/
If you use
#Laravel, check this out:
github.com/YanGusik/thrun_la…