Skip to content
thesis-phpPublic

Repository files navigation

Thesis

Check PHP License

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.

Packages

Package Release Description
thesis/amqp Release AMQP 0.9.1 client for RabbitMQ: publisher confirms, consumers as iterators, reconnects.
thesis/async Release Structured concurrency for PHP fibers with an event loop and task-tree cancellation.
thesis/async-trace Release Trace thesis/async tasks to diagnose cancellation, blocking code and long waits.
thesis/cache Release Cache interface with Time\Duration TTLs, a local LRU cache and stampede protection by a keyed mutex.
thesis/demo Release A small HTTP server with console logging that shows how concurrent requests overlap.
thesis/dispatcher Release Synchronous event dispatcher that matches events to listeners by parameter type.
thesis/exceptionally Release Turns PHP errors into exceptions around a callable, safe when the callable suspends a fiber.
thesis/formatter Release Formats PHP values, classes, functions and parameters into short strings for error messages.
thesis/hot-reload Release Restart a development server on file changes or SIGHUP, including after a failed launch.
thesis/http Release Asynchronous HTTP/1 client and server with connection pooling, routing and streamed bodies.
thesis/io Release Fast binary I/O: typed byte buffer, non-blocking streams, stdio and a string reader.
thesis/logger Release PSR-3 logger with bounded buffering and asynchronous JSON and colored console output.
thesis/net Release Non-blocking TCP and Unix sockets with TLS and an async DNS resolver, cancelled by the task tree.
thesis/phpstan-extension Release PHPStan extension for thesis packages: precise types where PHPDoc generics cannot express them.
thesis/process Release Group-owned Unix worker processes with signal handling and inherited IPC descriptors.
thesis/source-location Release Find source locations and callers outside a library, including in code run by eval().
thesis/testo-plugin Release Testo plugins for testing thesis/async code with real or virtual time and PHP errors as failures.
thesis/time Release Time\Duration polyfill for PHP 8.2+ with parsing, conversions, a stopwatch and PSR-20 clocks.

Development

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 checks

AGENTS.md describes the layout, the manifests and the rules of the monorepo.

Releases

Packages

Contributors

Languages