Search by

bronsted / fiberloop

sorenbronsted

Fiberloop

Package info

github.com/sorenbronsted/fiberloop

pkg:composer/bronsted/fiberloop

Statistics

Installs: 53

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

v2.1 2026-10-22 09:05 UTC

This package is auto-updated.

Last update: 2026-10-22 09:08:33 UTC


README

This package implements coroutines by utilizing php fibers. It does the same job a Revolt but implementation is different. It has the same interface as Revolt and I have expanded it a bit.

On top of this I have build Psr-Http which is a PSR complaint Http web server and a client.

Using coroutines enables you to write code which handles multiple tasks in php single threaded execution model. This makes your program efficient and can handle more work.

Installation

This package can be installed with Composer

`composer install bronsted\fiberloop`

Usage

The loop waits for stream readiness or the next timer deadline when no fibers are runnable. Waiting for one stream does not block other watchers or timers. Callbacks should still avoid blocking I/O and other blocking operations.

The optional timeout on readable watchers is a maximum polling interval in microseconds, not an inactivity timeout. A value of 0 waits for readiness; other scheduled work can still wake the loop.

Development

Containers started by the make targets have the bronsted.fiberloop label. make clean only removes exited or created containers with that label; running containers and unlabelled containers are left untouched.