True Asynchronous inside PHP
Imagine PHP with coroutines, where familiar functions support concurrent I/O. Build high-performance concurrent applications with clean, readable code and minimal changes!
Key Features
Coroutines
Lightweight coroutines for efficient concurrent execution. No colored async functions. Just do spawn() and go!
Non-blocking I/O
fread, fwrite, file_get_contents, ob_start, curl, MySQL, PostgreSQL. Regular PHP functions now work asynchronously without extra effort.
Async Web Servers
Support for the model: multiple requests — one PHP process.
Cooperative Cancellation
Simple and flexible API for coroutine cancellation. Scope::cancel().
Structured Concurrency
Control coroutine lifetime with Scope sandbox. Manage groups of coroutines via TaskGroup.
PDO Pool
Connection pooling built right into PDO. Automatic connection management for maximum performance.
Channel
Data exchange between coroutines. Buffered and unbuffered channels for producer/consumer patterns.
Futures
Deferred results for asynchronous computations. Composition via await_all, await_first.
Context
Data associated with a coroutine. Easy adaptation of code with global variables via Context.
Ready to Build Async PHP Applications?
Get started with TrueAsync in minutes. Install via Composer and start writing concurrent code today.