PHPackages                             api-clients/command-bus - 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. api-clients/command-bus

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

api-clients/command-bus
=======================

Light weight wrapper around league/tactician adding promised based interface(s) and next tick execution

2.1.2(5y ago)11196.7k↑16.7%1[3 PRs](https://github.com/php-api-clients/command-bus/pulls)4MITPHPPHP ^7.2CI failing

Since Oct 12Pushed 2y ago3 watchersCompare

[ Source](https://github.com/php-api-clients/command-bus)[ Packagist](https://packagist.org/packages/api-clients/command-bus)[ RSS](/packages/api-clients-command-bus/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (13)Versions (15)Used By (4)

Command Bus
===========

[](#command-bus)

[![Linux Build Status](https://camo.githubusercontent.com/4f048667d63da96dc4b5424d90ef28d72b3e984cc7e2ccff4419f5fdd549cfbe/68747470733a2f2f7472617669732d63692e6f72672f7068702d6170692d636c69656e74732f636f6d6d616e642d6275732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/php-api-clients/command-bus)[![Windows Build status](https://camo.githubusercontent.com/efdf792a69ee51077561343301fbc1c3fc69f72c3eb16b75d24f1d02a20acb8e/68747470733a2f2f63692e6170707665796f722e636f6d2f6170692f70726f6a656374732f7374617475732f673272753834786d736b6966726934793f7376673d74727565)](https://ci.appveyor.com/project/php-api-clients/command-bus)[![Latest Stable Version](https://camo.githubusercontent.com/7180e0310cc09ae7e2d07735715f4947d522383c31bb6b5d6d31e6a22300be18/68747470733a2f2f706f7365722e707567782e6f72672f6170692d636c69656e74732f636f6d6d616e642d6275732f762f737461626c652e706e67)](https://packagist.org/packages/api-clients/command-bus)[![Total Downloads](https://camo.githubusercontent.com/9c6b153b84963f442f973bb74b05cb6e5ea89566139991103e8de6cfcebda822/68747470733a2f2f706f7365722e707567782e6f72672f6170692d636c69656e74732f636f6d6d616e642d6275732f646f776e6c6f6164732e706e67)](https://packagist.org/packages/api-clients/command-bus)[![Code Coverage](https://camo.githubusercontent.com/807fe82099326a12a6decb1b77a5bd866ca3f6db32cc7135d8b48300ac06d330/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7068702d6170692d636c69656e74732f636f6d6d616e642d6275732f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/php-api-clients/command-bus/?branch=master)[![License](https://camo.githubusercontent.com/fb649294f1e6a443583f8cf577b9dafe5a649c76c5c2c5f74800cf14a8d0fad0/68747470733a2f2f706f7365722e707567782e6f72672f6170692d636c69656e74732f636f6d6d616e642d6275732f6c6963656e73652e706e67)](https://packagist.org/packages/api-clients/command-bus)[![PHP 7 ready](https://camo.githubusercontent.com/9e8ee8775a6eeb01f874c05089941545007fb6dd5c7ea72677479f4185517f4a/687474703a2f2f7068703772656164792e74696d6573706c696e7465722e63682f7068702d6170692d636c69656e74732f636f6d6d616e642d6275732f62616467652e737667)](https://appveyor-ci.org/php-api-clients/command-bus)

Light weight wrapper around [`league/tactician`](http://tactician.thephpleague.com/) adding [`promised`](https://github.com/reactphp/promise) based interface(s) and next tick execution.

Installation
============

[](#installation)

To install via [Composer](http://getcomposer.org/), use the command below, it will automatically detect the latest version and bind it with `^`.

```
composer require api-clients/command-bus

```

Usage
=====

[](#usage)

Simply pass the command bus a [`ReactPHP` event loop](https://github.com/reactphp/event-loop) and a `CommandHandlerMiddleware` and it will run each handle in a future tick on the passed event loop.

```
$commandHandlerMiddleware = new CommandHandlerMiddleware(/*...*/);
$commandBus = new CommandBus(
    $container->get(LoopInterface::class),
    $commandHandlerMiddleware
);
```

There is one note though, command handlers are encouraged to return promises them self.

License
=======

[](#license)

The MIT License (MIT)

Copyright (c) 2017 Cees-Jan Kiewiet

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

39

—

LowBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 56.9% 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 ~256 days

Recently: every ~301 days

Total

7

Last Release

1915d ago

Major Versions

1.0.0 → 2.0.02016-12-08

PHP version history (2 changes)1.0.0PHP ^7.0

2.1.0PHP ^7.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/147145?v=4)[Cees-Jan Kiewiet](/maintainers/WyriHaximus)[@WyriHaximus](https://github.com/WyriHaximus)

---

Top Contributors

[![WyriHaximus](https://avatars.githubusercontent.com/u/147145?v=4)](https://github.com/WyriHaximus "WyriHaximus (70 commits)")[![dependabot-support](https://avatars.githubusercontent.com/u/112581971?v=4)](https://github.com/dependabot-support "dependabot-support (23 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (15 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (14 commits)")[![mdrost](https://avatars.githubusercontent.com/u/4083346?v=4)](https://github.com/mdrost "mdrost (1 commits)")

---

Tags

hacktoberfestphpreactphp

### Embed Badge

![Health badge](/badges/api-clients-command-bus/health.svg)

```
[![Health](https://phpackages.com/badges/api-clients-command-bus/health.svg)](https://phpackages.com/packages/api-clients-command-bus)
```

###  Alternatives

[friendsofphp/php-cs-fixer

A tool to automatically fix PHP code style

13.5k234.7M20.6k](/packages/friendsofphp-php-cs-fixer)[react/react

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

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

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

689126.8M194](/packages/react-stream)[react/child-process

Event-driven library for executing child processes with ReactPHP.

34076.1M136](/packages/react-child-process)[roave/backward-compatibility-check

Tool to compare two revisions of a public API to check for BC breaks

5953.3M56](/packages/roave-backward-compatibility-check)[react/zmq

ZeroMQ bindings for React.

2471.7M31](/packages/react-zmq)

PHPackages © 2026

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