PHPackages                             uppes/eventloop - 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. uppes/eventloop

Abandoned → [techno-express/eventloop](/?search=techno-express%2Feventloop)ArchivedLibrary[Utility &amp; Helpers](/categories/utility)

uppes/eventloop
===============

An event loop library for asynchronous PHP programming.

1.1.7(7y ago)1512MITPHPPHP &gt;7.0

Since Feb 14Pushed 7y agoCompare

[ Source](https://github.com/techno-express/eventloop)[ Packagist](https://packagist.org/packages/uppes/eventloop)[ Docs](https://github.com/uppes/eventloop)[ RSS](/packages/uppes-eventloop/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

[![Build Status](https://camo.githubusercontent.com/f75782f817072782b93131b4e6bbf12e9bce280c3f0f9673da811f7e5c5ab5fb/68747470733a2f2f7472617669732d63692e6f72672f75707065732f6576656e746c6f6f702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/uppes/eventloop)[![codecov](https://camo.githubusercontent.com/0712efa2f779559ccad657fe4ef2c895b4dea14d87c869f1de1c2cd41a957100/68747470733a2f2f636f6465636f762e696f2f67682f75707065732f6576656e746c6f6f702f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/uppes/eventloop)[![Codacy Badge](https://camo.githubusercontent.com/b424e3fb042ada2185a85da2cf64795ef6caac7660e308fd25afe2623e79b740/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3736353966626537623564623433373039393733613764363162613231623530)](https://www.codacy.com/app/techno-express/eventloop?utm_source=github.com&utm_medium=referral&utm_content=uppes/eventloop&utm_campaign=Badge_Grade)

Event Loop
==========

[](#event-loop)

This library's core uses the [reactor pattern](https://en.wikipedia.org/wiki/Reactor_pattern) to handle normally [blocking I/O](https://nodejs.org/en/docs/guides/blocking-vs-non-blocking/#blocking) function/event **calls**.

Concepts
--------

[](#concepts)

[The Reactor and Singleton Pattern](https://youtu.be/pmtrUcPs4GQ) **video**

[Patterns and Frameworks for Synch Event Handling, Connections, and Service Initialization](https://youtu.be/m-J9FCFOMUE) **video**

The [*reactor pattern*](https://youtu.be/izdvImum8ow) is an event handling pattern for handling service requests delivered concurrently to a service handler by one or more inputs. @see [Reactor](https://github.com/tpn/pdfs/blob/master/Reactor%20-%20An%20Object%20Behavioral%20Pattern%20for%20Demultiplexing%20and%20Dispatching%20Handles%20for%20Synchronous%20Events.pdf) - An Object Behavioral Pattern for Demultiplexing and Dispatching Handles for Synchronous Events.

PHP wasn't built from the ground up with an [Event Loop](https://en.wikipedia.org/wiki/Event_loop) concept in mind, like other Languages, *Python*, *JavaScript* for one.

Like *Python* and *JavaScript*, *PHP* is single threaded. It can handle asynchronous event base programming quite well, however there is no standard library way to implement.

[Event Loop From the Inside Out](https://youtu.be/P9csgxBgaZ8) **video**

[Help I'm stuck in an event loop](https://youtu.be/6MXRNXXgP_0) **video**

[What Is Async, How Does It Work, and When Should I Use It?](https://youtu.be/kdzL3r-yJZY) **video**

[Common asynchronous patterns](https://youtu.be/jq2IFUQRbGo) **video**

In order to have any async behavior programming, the based libraries needs to be interoperable, and they need to use the same event loop.

This Event Loop form the the basics for our **[Promise/A+](https://github.com/uppes/promisplus)** package.

This component provides a common `LoopInterface` that any library can target. This allows them to be used in the same loop, with one single [`run()`](#run) call that is controlled by the user.

### Table of Contents

[](#table-of-contents)

- [Quickstart example](#quickstart-example)
- [Usage](#usage)
    - [Loop](#Loop)
        - [getInstance()](#getInstance)
    - [Loop implementations](#loop-implementations)
        - [Stream\_Select()](Stream_Select)
    - [LoopInterface](#loopinterface)
        - [getInstance()](#getInstance)
        - [addTimeout()](#addTimeout)
        - [setInterval()](#setInterval)
        - [clearInterval()](#clearInterval)
        - [addReadStream()](#addReadStream)
        - [addWriteStream()](#addWriteStream)
        - [removeReadStream()](#removeReadStream)
        - [removeWriteStream()](#removeWriteStream)
        - [run()](#run)
        - [tick()](#tick)
        - [stop()](#stop)
        - [addTick()](#addTick)
        - [addSignal()](#addsignal)
        - [removeSignal()](#removesignal)
- [Install](#install)
- [Tests](#tests)
- [License](#license)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

###  Release Activity

Cadence

Every ~41 days

Total

3

Last Release

2565d ago

PHP version history (2 changes)1.1.5PHP &gt;7.1

1.1.7PHP &gt;7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/b1a9d88c23f07f785e0358746ae2384950a6f8dac0c3bd4fbbc910e94f7eb637?d=identicon)[techno-express](/maintainers/techno-express)

---

Top Contributors

[![TheTechsTech](https://avatars.githubusercontent.com/u/29784725?v=4)](https://github.com/TheTechsTech "TheTechsTech (43 commits)")

---

Tags

event-loopasynchronouseventsevent-drivenpcntlstream-selectnext tick

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/uppes-eventloop/health.svg)

```
[![Health](https://phpackages.com/badges/uppes-eventloop/health.svg)](https://phpackages.com/packages/uppes-eventloop)
```

###  Alternatives

[doctrine/event-manager

The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.

6.1k501.1M115](/packages/doctrine-event-manager)[react/event-loop

ReactPHP's core reactor event loop that libraries can use for evented I/O.

1.3k139.6M664](/packages/react-event-loop)[psr/event-dispatcher

Standard interfaces for event handling.

2.3k618.8M865](/packages/psr-event-dispatcher)[react/react

ReactPHP: Event-driven, non-blocking I/O with PHP.

9.1k3.6M63](/packages/react-react)[laminas/laminas-eventmanager

Trigger and listen to events within a PHP application

1.0k69.8M225](/packages/laminas-laminas-eventmanager)[react/stream

Event-driven readable and writable streams for non-blocking I/O in ReactPHP

688126.8M194](/packages/react-stream)

PHPackages © 2026

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