PHPackages                             drsnyder/brook - 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. drsnyder/brook

ActiveLibrary[Framework](/categories/framework)

drsnyder/brook
==============

A lightweight concurrency framework for PHP based on zeromq.

1.0.0-alpha(12y ago)38MITPHP

Since Apr 11Pushed 12y ago1 watchersCompare

[ Source](https://github.com/drsnyder/brook)[ Packagist](https://packagist.org/packages/drsnyder/brook)[ RSS](/packages/drsnyder-brook/feed)WikiDiscussions master Synced 3d ago

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

Brook
=====

[](#brook)

A lightweight concurrency framework for PHP based on zeromq.

Summary
-------

[](#summary)

Brook was created to make concurrent stream processing more accessible in PHP. It's built on top of [zeromq](http://zeromq.org/) and uses the fan-out pattern to distribute work.

Usage
-----

[](#usage)

Here is a simple examlpe where 20 messages are fanned out and multiplied then collected and confirmed back in the main thread of execution.

```
 class MultiplicationTask implements \Brook\TaskInterface {
   const MULTIPLIER = 2;

   public function setup() { }
   public function tearDown() { }

   public function work($value) {
     return sprintf("%d %d", $value, $value * self::MULTIPLIER);
   }
 }

 $messageCount = 20;

 $fanOut = new Brook\FanOut();
 $fanOut->distributeWork(2, new MultiplicationTask());

 for ($i=1; $ienqueue($i);
   echo "sent $i", PHP_EOL;
 }

 for ($i=1; $ireadFromSink();
   list($value, $multiplied) = explode(' ', $result);

   echo "got $value, $multiplied", PHP_EOL;
   assert($multiplied == (MultiplicationTask::MULTIPLIER * $value));
 }

 $fanOut->shutdown();

```

LICENSE (MIT)
-------------

[](#license-mit)

Copyright (c) 2014 Damon Snyder

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

Unknown

Total

1

Last Release

4416d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5bd5e112abd47d9c4e1094d8ce1bfa3d6bbbfa1fc8b897b6a77ebd6689a19470?d=identicon)[drsnyder](/maintainers/drsnyder)

---

Top Contributors

[![drsnyder](https://avatars.githubusercontent.com/u/21621?v=4)](https://github.com/drsnyder "drsnyder (12 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/drsnyder-brook/health.svg)

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

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M192](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)

PHPackages © 2026

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