Tutorials
A step-by-step introduction to TrueAsync: from your first coroutine to structured concurrency, resource pools, and real parallelism. The tutorials build on each other, so we recommend going through them in order, starting with the first one.
0 / 30 completed
Basics
Coroutines
Your first look at coroutines: spawn() and concurrent execution.
Cancellation
How cancel() and cooperative cancellation work.
Await
Why await() exists and how it works with coroutines.
Exceptions
How exceptions from a coroutine propagate through await().
Timeouts
Bounding how long await() waits with timeout().
Future
Future and FutureState: a promise of a result that isn't tied to a coroutine.
Channels
Channel: a stream of values between coroutines, worker pools, and backpressure.
Scope
Who owns a group of coroutines, waits for them, and cancels them together.
PDO Pool
Why coroutines can't share one PDO connection, and how the built-in pool solves it transparently.
TaskGroup
A group of tasks with results and all, race, any waiting strategies.
TaskSet
A stream of tasks with auto-cleanup, joinNext/joinAny/joinAll, and a supervisor loop.
Concurrent Iterator
iterate(): concurrent traversal of a collection in one line.
Pool
Async\Pool: a general-purpose resource pool with health checks and a circuit breaker.
Threads
spawn_thread and ThreadPool: real parallelism for CPU-bound work.
Context
Where to keep "the current thing" now that global variables no longer work.
TrueAsync Server
First Server
An HTTP server inside PHP: HttpServer, HttpServerConfig, and your first handler.
Request and Response
HttpRequest and HttpResponse: routing, json(), and errors via HttpException.
Concurrency Inside a Request
TaskGroup in a handler, the PDO Pool under load, and request_context().
Byte Streams
send() and sendable(), streaming the request body, file uploads, and sendFile().
Static Files
StaticHandler: serving files without a PHP coroutine, caching, and safety policies.
Server-Sent Events
SSE: a stream of events to the browser, import progress, and heartbeats via sseComment().
WebSocket
The recv loop, a chat room, send from other coroutines, and trySend against slow clients.
Workers and HTTP/3
setWorkers(): threads under the server hood, the bootloader, and HTTP/3 on the same port.
Production
Timeouts, limits, backpressure on accept, compression, logging, and graceful shutdown.
gRPC
addGrpcHandler(): unary and streaming, readMessage/writeMessage, trailers, and deadlines.
Laravel
First Run
Running Laravel under TrueAsync Server and your first API, from routes to the database.
Pool & Transactions
PDO Pool under Eloquent and CoroutineTransactions: why the nested transaction counter can't stay on a Connection property.
SSE & gRPC
trueasync_response(), Sse, and grpc_handlers: reaching past the buffered Illuminate Response right from a controller.
Unsafe Patterns
Mutable static properties, once() on a singleton, and Number::useLocale(): the usual ways state leaks between requests, and how to catch them with static analysis.
Third-Party Packages
Debugbar, Telescope, Inertia, spatie/permission, Socialite: what's already adapted for coroutines and what's worth disabling.