Search by

thesis / demo

vudaltsov

A small HTTP server with console logging that shows how concurrent requests overlap.

Package info

github.com/thesis-php/demo

Issues

Type:project

pkg:composer/thesis/demo

Fund package maintenance!

www.tinkoff.ru/cf/5MqZQas2dk7

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

dev-main / 0.1.x-dev 2026-11-23 23:09 UTC

This package is not auto-updated.

Last update: 2026-11-23 23:35:14 UTC


README

Thesis Demo

PHP Release License PHPStan

This read-only repository mirrors packages/demo. Open issues and pull requests in the thesis-php/thesis monorepo.

Report a bug · Request a feature · Changelog · Contributing

Each HTTP request waits for 250 ms, then returns OK and the request path. The console log timestamps the start and finish of each request so you can see the waits overlap.

Run

Use 64-bit PHP 8.6 with Io\Poll\Context and ext-pcntl on Unix. Once the split is on Packagist, install the development version with Composer.

composer create-project thesis/demo demo dev-main
cd demo
php run.php

From the monorepo root, run make install, then start the server in Docker.

docker compose run --rm -p 127.0.0.1:8080:8080 php php packages/demo/run.php 0.0.0.0:8080

In another terminal, send the same eight requests sequentially and then concurrently.

time curl -fsS 'http://127.0.0.1:8080/[1-8]'
time curl -fsS --parallel --parallel-immediate 'http://127.0.0.1:8080/[1-8]'

On an idle machine, expect about two seconds for the first command and about 250 ms for the second. In the parallel run, all eight Started lines appear before the first Finished line. Press Ctrl+C to stop the server.

The server and logger are wired in run.php.