PHPackages                             valeriitropin/socketio-emitter - 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. [Caching](/categories/caching)
4. /
5. valeriitropin/socketio-emitter

ActiveLibrary[Caching](/categories/caching)

valeriitropin/socketio-emitter
==============================

1.0.0(8y ago)023MITPHP

Since Dec 18Pushed 8y ago1 watchersCompare

[ Source](https://github.com/valeriitropin/php-socketio-emitter)[ Packagist](https://packagist.org/packages/valeriitropin/socketio-emitter)[ RSS](/packages/valeriitropin-socketio-emitter/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (2)Used By (0)

PHP socket.io emitter
=====================

[](#php-socketio-emitter)

Async implementation of socket.io emitter written in php. Built on top of [ReactPHP](https://reactphp.org/) components.

Installation
------------

[](#installation)

```
composer require valeriitropin/socketio-emitter

```

How to use
----------

[](#how-to-use)

```
use React\EventLoop\Factory as ReactFactory;
use ValeriiTropin\Socketio\Emitter;

$loop = ReactFactory::create();
$emitter = new Emitter($loop);

$promise = $emitter->to($room)->emit($event, $data)
    ->then(function () {})
    ->otherwise(function ($error) {});
```

API
---

[](#api)

### Emitter

[](#emitter)

#### \_\_construct(React\\EventLoop\\LoopInterface $loop, $options = \[\], ValeriiTropin\\Socketio\\PackerInterface $packer = null)

[](#__constructreacteventlooploopinterface-loop-options---valeriitropinsocketiopackerinterface-packer--null)

##### $options:

[](#options)

- `key`: pub/sub events prefix (`socket.io`)
- `namespace`: socket.io namespace (`/`)
- `uri`: Redis connection string, see [docs](https://github.com/clue/php-redis-react/blob/master/README.md#createclient) (`localhost`)
- `client`: pub client

### to($room): ValeriiTropin\\Socketio\\Emitter

[](#toroom-valeriitropinsocketioemitter)

Adds room and returns current `Emitter` instance

```
$emitter->to($room);
```

### of($namespace): ValeriiTropin\\Socketio\\Emitter

[](#ofnamespace-valeriitropinsocketioemitter)

Creates new `Emitter` instance with given namespace.

```
$emitter->of($namespace);
```

### emit($event, ...$args): React\\Promise\\Promise

[](#emitevent-args-reactpromisepromise)

Emits event with data to set rooms.

```
$emitter->emit($event, $data)
    ->then(function () {})
    ->otherwise(function ($error) {});
```

### getLoop(): React\\EventLoop\\LoopInterface

[](#getloop-reacteventlooploopinterface)

Returns loop instance.

Links
-----

[](#links)

- [Socket.io](https://github.com/socketio/socket.io)
- [Socket.io Redis adapter](https://github.com/socketio/socket.io-redis)
- [ReactPHP promises](https://reactphp.org/promise/)
- [ReactPHP Redis](https://github.com/clue/php-redis-react)

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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

Unknown

Total

1

Last Release

3115d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5775964?v=4)[Valerii Tropin](/maintainers/valeriitropin)[@valeriitropin](https://github.com/valeriitropin)

---

Top Contributors

[![valeriitropin](https://avatars.githubusercontent.com/u/5775964?v=4)](https://github.com/valeriitropin "valeriitropin (1 commits)")

---

Tags

redisemitterSocket.io

### Embed Badge

![Health badge](/badges/valeriitropin-socketio-emitter/health.svg)

```
[![Health](https://phpackages.com/badges/valeriitropin-socketio-emitter/health.svg)](https://phpackages.com/packages/valeriitropin-socketio-emitter)
```

###  Alternatives

[predis/predis

A flexible and feature-complete Redis/Valkey client for PHP.

7.8k318.6M2.7k](/packages/predis-predis)[snc/redis-bundle

A Redis bundle for Symfony

1.0k40.4M72](/packages/snc-redis-bundle)[clue/redis-protocol

A streaming Redis protocol (RESP) parser and serializer written in pure PHP.

5214.4M13](/packages/clue-redis-protocol)[cache/redis-adapter

A PSR-6 cache implementation using Redis (PhpRedis). This implementation supports tags

534.0M27](/packages/cache-redis-adapter)[rtcamp/nginx-helper

Cleans nginx's fastcgi/proxy cache or redis-cache whenever a post is edited/published. Also provides cloudflare edge cache purging with Cache-Tags.

23617.0k1](/packages/rtcamp-nginx-helper)[rtckit/react-redlock

Asynchronous distributed locks with Redis and ReactPHP

177.8k1](/packages/rtckit-react-redlock)

PHPackages © 2026

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