Experimental Version

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 and other APIs out of the box. 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, covering various scenarios.

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

Type-safe data exchange between coroutines. Buffered and unbuffered channels for producer/consumer patterns.

Futures

Deferred results for asynchronous computations. Composition via awaitAll, awaitFirst and flexible result management.

Context

Context propagation through the entire coroutine tree. Timeouts, deadlines and operation cancellation with automatic resource cleanup.

Ready to Build Async PHP Applications?

Get started with TrueAsync in minutes. Install via Composer and start writing concurrent code today.