Thesis provides structured concurrency for PHP fibers on an event loop that uses PHP 8.6's Io\Poll.
It includes non-blocking I/O, TCP, TLS and DNS, a RabbitMQ client and tools for those packages.
Thesis runs on Unix. Packages that use I/O and store time as integer nanoseconds require 64-bit PHP.
This is the development monorepo. Every package in packages/ is published as thesis/<name>
from a read-only repository of its own, so issues and pull requests go here.
| Package | Release | Description |
|---|---|---|
| thesis/amqp | AMQP 0.9.1 client for RabbitMQ: publisher confirms, consumers as iterators, reconnects. | |
| thesis/async | Structured concurrency for PHP fibers with an event loop and task-tree cancellation. | |
| thesis/async-trace | Trace thesis/async tasks to diagnose cancellation, blocking code and long waits. | |
| thesis/cache | Cache interface with Time\Duration TTLs, a local LRU cache and stampede protection by a keyed mutex. | |
| thesis/demo | A small HTTP server with console logging that shows how concurrent requests overlap. | |
| thesis/dispatcher | Synchronous event dispatcher that matches events to listeners by parameter type. | |
| thesis/exceptionally | Turns PHP errors into exceptions around a callable, safe when the callable suspends a fiber. | |
| thesis/formatter | Formats PHP values, classes, functions and parameters into short strings for error messages. | |
| thesis/hot-reload | Restart a development server on file changes or SIGHUP, including after a failed launch. | |
| thesis/http | Asynchronous HTTP/1 client and server with connection pooling, routing and streamed bodies. | |
| thesis/io | Fast binary I/O: typed byte buffer, non-blocking streams, stdio and a string reader. | |
| thesis/logger | PSR-3 logger with bounded buffering and asynchronous JSON and colored console output. | |
| thesis/net | Non-blocking TCP and Unix sockets with TLS and an async DNS resolver, cancelled by the task tree. | |
| thesis/phpstan-extension | PHPStan extension for thesis packages: precise types where PHPDoc generics cannot express them. | |
| thesis/process | Group-owned Unix worker processes with signal handling and inherited IPC descriptors. | |
| thesis/source-location | Find source locations and callers outside a library, including in code run by eval(). | |
| thesis/testo-plugin | Testo plugins for testing thesis/async code with real or virtual time and PHP errors as failures. | |
| thesis/time | Time\Duration polyfill for PHP 8.2+ with parsing, conversions, a stopwatch and PSR-20 clocks. |
Run the development commands in Docker through Make. make help lists the targets.
make i # install dependencies
make test P=async # test one package
make check # run style, Rector, PHPStan, dependency and test checksAGENTS.md describes the layout, the manifests and the rules of the monorepo.