PHPackages                             iquety/pubsub - 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. [Framework](/categories/framework)
4. /
5. iquety/pubsub

ActiveLibrary[Framework](/categories/framework)

iquety/pubsub
=============

Library for implementing the Publish/Subscribe architectural pattern

v2.2.1(1mo ago)0581↓100%2MITPHPPHP ^8.4CI passing

Since Nov 12Pushed 1mo agoCompare

[ Source](https://github.com/iquety/pubsub)[ Packagist](https://packagist.org/packages/iquety/pubsub)[ RSS](/packages/iquety-pubsub/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (15)Used By (2)

Iquety Pub/Sub
==============

[](#iquety-pubsub)

[![GitHub Release](https://camo.githubusercontent.com/79cb4b134c8709c87f7b58621c37496b1b0f5f93118d10212cd1dd4ebfb5da1f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6971756574792f7075627375622e737667)](https://github.com/iquety/pubsub/releases/latest)[![PHP Version](https://camo.githubusercontent.com/504ead6a583c68d8d62d7bfceed24e569ca613d7a36bed380281b3455b5c7b31/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e342d626c7565)](https://camo.githubusercontent.com/504ead6a583c68d8d62d7bfceed24e569ca613d7a36bed380281b3455b5c7b31/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e342d626c7565)[![License](https://camo.githubusercontent.com/b8cadaa967891081f8f165695470689986c028821dd8a040132f6e661795dc0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c7565)](https://camo.githubusercontent.com/b8cadaa967891081f8f165695470689986c028821dd8a040132f6e661795dc0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c7565)[![Codacy Grade](https://camo.githubusercontent.com/6bfe8742e8bd418dbd6f3b72b230b7ec467f38a94d11d3bcdb5a7e9677be5f1e/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3862326138373632633633613463316239343935623036366664303065383264)](https://www.codacy.com/gh/iquety/pubsub/dashboard?utm_source=github.com&utm_medium=referral&utm_content=iquety/pubsub&utm_campaign=Badge_Grade)[![Codacy Coverage](https://camo.githubusercontent.com/be2f9dadd4d8583bcce2f4ca664c698121297c9651f659f8b427ad830afca99c/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f436f7665726167652f3862326138373632633633613463316239343935623036366664303065383264)](https://www.codacy.com/gh/iquety/pubsub/dashboard?utm_source=github.com&utm_medium=referral&utm_content=iquety/pubsub&utm_campaign=Badge_Coverage)

[English](readme.md)[Português](./docs/pt-br/leiame.md)Synopsis
--------

[](#synopsis)

This repository contains the necessary functionalities to run a Publish/Subscribe system, making it possible to subscribe and publish events.

```
composer require iquety/pubsub
```

For detailed information, see [Documentation Summary](docs/en/index.md).

How it works
------------

[](#how-it-works)

### 1. Run the event server

[](#1-run-the-event-server)

At the root of this repository, there is a terminal command to exemplify the process. It can be used as follows:

```
# running in local PHP
./broker pubsub:broker -c 'tests/Example/config-file.php' -v

ou

# running in Dockerized PHP
./composer pubsub-server
```

```
# Server terminal running

➜ Using JsonEventSerializer serializer
➜ Verbose mode enabled
✔ The publish/subscriber server has been started in tcp://localhost:7703

```

Ready! The event server is running on port 7703, which will be available to receive events.

> **Note**: while the server is running, the current terminal will be in "watch" mode, waiting to receive events. The "-v" option activates the "verbose" mode, so that whenever an event is received, the server will notify the running terminal.

### 3. Send events to the server

[](#3-send-events-to-the-server)

With the server running, just open another terminal and use the command below to send some test events:

```
# running in local PHP
./broker pubsub:client-test -d localhost -p 7703 -v

ou

# running in Dockerized PHP
./composer pubsub-client
```

The two terminals will react to the sending of events, showing the corresponding information:

```
# Terminal where events were sent

✔ Publish event of type 'EventOne' to channel 'channel-vormir' in tcp://localhost:7703
✔ Publish event of type 'EventTwo' to channel 'channel-vormir' in tcp://localhost:7703
✔ Publish event of type 'EventTwo' to channel 'channel-mordor' in tcp://localhost:7703
✔ Publish event of type 'EventTwo' to channel 'channel-greenville' in tcp://localhost:7703
➜ Published Events
➜ Used memory: 1921928

```

```
# Server terminal that received the events

➜ [2022-06-03 17:06:09]: Message of type 'EventOne' received on channel 'channel-vormir'
Message dispatched to SubscriberOne
Message dispatched to SubscriberTwo

➜ [2022-06-03 17:06:09]: Message of type 'EventTwo' received on channel 'channel-vormir'
Message dispatched to SubscriberTwo

...

```

Características
---------------

[](#características)

- Coded with best practices and maximum quality;
- Well documented and IDE friendly;
- Made with TDD (Test Driven Development);
- Implemented with unit tests using PHPUnit;
- Made with ❤️ &amp; ☕.

Credits
-------

[](#credits)

[Ricardo Pereira Dias](https://www.ricardopedias.com.br)

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance89

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity71

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

Every ~101 days

Recently: every ~80 days

Total

13

Last Release

53d ago

Major Versions

v0.3.0 → v1.0.02024-07-04

v1.4.0 → v2.0.02026-02-02

PHP version history (3 changes)v0.1.0PHP ^8.0.0

v1.0.0PHP ^8.3

v2.0.0PHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/35d81085a41c534f640bed85b37506ebc87ad0653784d93dab4f649ffc30e415?d=identicon)[ricardopedias](/maintainers/ricardopedias)

---

Top Contributors

[![ricardopedias](https://avatars.githubusercontent.com/u/27714431?v=4)](https://github.com/ricardopedias "ricardopedias (124 commits)")

---

Tags

frameworkeventspublishsubscribepubsub

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/iquety-pubsub/health.svg)

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

###  Alternatives

[nuwber/rabbitevents

The Nuwber RabbitEvents package

120515.8k3](/packages/nuwber-rabbitevents)[pestphp/pest-plugin-stressless

Stressless plugin for Pest

67792.6k16](/packages/pestphp-pest-plugin-stressless)[nimbly/syndicate

A powerful queue and pubsub message publisher and consumer framework.

304.2k](/packages/nimbly-syndicate)

PHPackages © 2026

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