PHPackages                             onion/event-loop - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. onion/event-loop

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

onion/event-loop
================

0815[1 PRs](https://github.com/phOnion/event-loop/pulls)1PHP

Since Apr 29Pushed 2y agoCompare

[ Source](https://github.com/phOnion/event-loop)[ Packagist](https://packagist.org/packages/onion/event-loop)[ RSS](/packages/onion-event-loop/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (4)Used By (1)

Introduction
============

[](#introduction)

This is the async event loop that entirely relies on PHP 8.1 Fibers in order to provide native async functionality. By:

1. Introducing a `coroutine` function to do execution on the event loop
2. Add `tick` function that allows for handling control back to the event loop to play nice with other coroutines
3. Introduce custom stream wrapper (`async://`) that uses signals to better break IO operations transparently for the applications.
4. Patching the native `file://` stream to handle all (except `.php` files, since it causes race conditions with autoloader/file inclusion) transparently.

Known issues
============

[](#known-issues)

When working with `symplely/uv-ffi` you should manually call `scheduler()->start()` to start the event loop explicitly and not rely on the automated start, because the FFI extension gets unloaded, before the full script termination.

---

Functions
=========

[](#functions)

`channel` - a function that creates either buffered or un-buffered channel for exchanging data between 2 or more coroutines. The type of channel is determined if any value is provided to its `$size`parameter

`coroutine` - a function that adds the provided function to the event loop to be executed with the provided arguments

`tick` - a signal wrapper, that is intended for complex/heavy code in order to "mark" point at which the function can handle back control to the event loop in order to allow it to execute other scheduled tasks. (this should be used for "low level" code and thus transparent for the end-user)

`signal` - this this function is used to "signal" the event loop to interrupt the currently running task until the provided callback indicates that it should be resumed and optionally passing a value that is the result of the execution

`read` - wait for the given stream to become readable and execute the function provided

`write` - same as `read` but for writing

`is_pending` - checks if a given stream has data that is to be read/written at the time of execution

`sleep` - non-blocking sleep function that suspends the coroutine it is executed in until a given time

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 Bus Factor1

Top contributor holds 98.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/ebe6247144a757a92ffa4f6844481b44b2c3be096076560e14a14e89053719b5?d=identicon)[DaGhostman](/maintainers/DaGhostman)

---

Top Contributors

[![DaGhostman](https://avatars.githubusercontent.com/u/2286949?v=4)](https://github.com/DaGhostman "DaGhostman (306 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (1 commits)")

### Embed Badge

![Health badge](/badges/onion-event-loop/health.svg)

```
[![Health](https://phpackages.com/badges/onion-event-loop/health.svg)](https://phpackages.com/packages/onion-event-loop)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
