An ecosystem of asynchronous PHP on an event loop of its own, on Io\Poll of PHP 8.6:
structured concurrency for fibers, non-blocking I/O, TCP, TLS and DNS, an AMQP client and the tools around them.
Unix only, the packages with I/O and time in int 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 on an event loop of its own: cancellation is a property of the task tree. | |
| thesis/async-trace | Tools around the trace of thesis/async: its events written as NDJSON and as lines of text for tests, who has cancelled a scope and why, code that blocks the others, waits that last too long. | |
| thesis/cache | Cache interface with Time\Duration TTLs, a local LRU cache and stampede protection by a keyed mutex. | |
| thesis/dispatcher | Synchronous event dispatcher: a listener gets the events of the type of its parameter, resolved once per class. | |
| 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/io | Fast binary I/O: byte buffer with typed encoding, non-blocking streams and stdio. | |
| 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/source-location | Where in the source code: a file and a line, the caller outside a library, the code of eval() resolved. | |
| thesis/testo-plugin | Testo plugins for thesis packages: tests in the event loop of thesis/async, real or virtual time, PHP errors as failures. | |
| thesis/time | Time\Duration polyfill for PHP >=8.2, shorthands like sec(5) and toMs(), PSR-20 clocks. |
Everything runs in Docker, see make help.
make i # install dependencies
make test P=async # test one package
make check # everything CI runsAGENTS.md describes the layout, the manifests and the rules of the monorepo.