Skip to content
thesis-phpPublic

About

Asynchronous PHP on an event loop of its own: structured concurrency for fibers, non-blocking I/O, TCP/TLS/DNS, HTTP/1 server, AMQP, PSR-3 logging. Monorepo of the thesis/* packages.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

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 its own event loop, task-tree cancellation and lazy initialization.
thesis/async-trace Release 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 Release Cache interface with Time\Duration TTLs, a local LRU cache and stampede protection by a keyed mutex.
thesis/dispatcher Release Synchronous event dispatcher: a listener gets the events of the type of its parameter, resolved once per class.
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/http Release HTTP messages shared by clients and servers: requests with query parameters, responses, headers, streamed bodies with trailers, and a strict HTTP/1.1 codec that refuses what request smuggling is made of.
thesis/http-client Release Asynchronous HTTP/1 client for HTTP and HTTPS with connection pooling, streaming bodies and trailers.
thesis/http-server Release Asynchronous HTTP/1 server for TCP and Unix sockets with streaming bodies, trailers, TLS and graceful shutdown.
thesis/io Release Fast binary I/O: typed byte buffer, non-blocking streams, stdio and a string reader.
thesis/log Release PSR-3 logger with a configurable clock, 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/source-location Release Where in the source code: a file and a line, the caller outside a library, the code of eval() resolved.
thesis/testo-plugin Release Testo plugins for thesis packages: tests in the event loop of thesis/async, real or virtual time, PHP errors as failures.
thesis/time Release Time\Duration polyfill for PHP >=8.2, shorthands like sec(5) and toMs(), strings like 1h30m, 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             # everything CI runs

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

About

Asynchronous PHP on an event loop of its own: structured concurrency for fibers, non-blocking I/O, TCP/TLS/DNS, HTTP/1 server, AMQP, PSR-3 logging. Monorepo of the thesis/* packages.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages