PHPackages                             rkr/service-dispatcher - 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. rkr/service-dispatcher

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

rkr/service-dispatcher
======================

0.3.14(3mo ago)21.9k↑78.6%1MITPHPPHP &gt;= 8.1CI failing

Since May 12Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/rkrx/php-service-dispatcher)[ Packagist](https://packagist.org/packages/rkr/service-dispatcher)[ RSS](/packages/rkr-service-dispatcher/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (13)Versions (40)Used By (0)

php-service-dispatcher
======================

[](#php-service-dispatcher)

[![Build Status](https://camo.githubusercontent.com/f8f4741fac34021ab7e04a22ebc987dd2f88633f8a654cea827001b68d0dae78/68747470733a2f2f7472617669732d63692e6f72672f726b72782f7068702d736572766963652d646973706174636865722e737667)](https://travis-ci.org/rkrx/php-service-dispatcher)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/bda3bb8d040b810692917bb62279e652147a211a8918dcfffe94d522bafebd58/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f726b72782f7068702d736572766963652d646973706174636865722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/rkrx/php-service-dispatcher/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/77a0799b4ac9da94a16c903d1d596ffeb701410f3898d54d8dea1a2ec8a66393/68747470733a2f2f706f7365722e707567782e6f72672f726b722f736572766963652d646973706174636865722f762f737461626c65)](https://packagist.org/packages/rkr/service-dispatcher)[![License](https://camo.githubusercontent.com/ae22a063687da43ce01ec840915d1c2d8edc2ab724eed154832e15824e797917/68747470733a2f2f706f7365722e707567782e6f72672f726b722f736572766963652d646973706174636865722f6c6963656e7365)](https://packagist.org/packages/rkr/service-dispatcher)

Common usage using SQLite
-------------------------

[](#common-usage-using-sqlite)

A simple service dispatcher for shell scripts. The intent is to run a php-cli script every minute and let the script decide, what to run at what time...

```
use Kir\Services\Cmd\Dispatcher\Dispatcher;

require __DIR__ . '/vendor/autoload.php';

use Kir\Services\Cmd\Dispatcher\ServiceDispatcherBuilder;

$dispatcher = ServiceDispatcherBuilder::withSQLite(__DIR__.'/services.db')->build();

$dispatcher->register('service1', Dispatcher::ONE_HOUR, function () {
	// Do something
	throw new Exception();
});

$dispatcher->register('service2', Dispatcher::ONE_HOUR * 3, function () {
	// Do something
});

$dispatcher->run();
```

The example above show the simplest usage of the service dispatcher. Two services get registered. "Service1" and "Service2". If one service throws an exception, the whole execution stops. Next time, the failed service starts at the end of the queue. If a service was successfully executed, the timeout schedules the service in this case to 1 hour (3600 seconds) in the future.

MySQL-Specific settings:
------------------------

[](#mysql-specific-settings)

```
use Kir\Services\Cmd\Dispatcher\ServiceDispatcherBuilder;

require __DIR__ . '/vendor/autoload.php';

/* ...  */

$dispatcher = ServiceDispatcherBuilder::withMySQL($pdo)
->useLocking(true)
->setLockPrefix('my-app:')
->build();

$dispatcher->register(/*...*/);

/* ...  */
```

###  Health Score

51

—

FairBetter than 95% of packages

Maintenance82

Actively maintained with recent releases

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity74

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 ~114 days

Recently: every ~92 days

Total

39

Last Release

95d ago

PHP version history (5 changes)0.0.1PHP &gt;= 5.4

0.0.3.1PHP &gt;= 5.3

0.2.0PHP &gt;= 7.0

0.3PHP &gt;= 7.1

0.3.10PHP &gt;= 8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/7f83d7e57a4bf3f1309680dbfbbf2d022f0ee6dae64a4b3bdfbed1226f2f6bef?d=identicon)[rkr](/maintainers/rkr)

---

Top Contributors

[![rkrx](https://avatars.githubusercontent.com/u/5672982?v=4)](https://github.com/rkrx "rkrx (83 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Type Coverage Yes

### Embed Badge

![Health badge](/badges/rkr-service-dispatcher/health.svg)

```
[![Health](https://phpackages.com/badges/rkr-service-dispatcher/health.svg)](https://phpackages.com/packages/rkr-service-dispatcher)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M203](/packages/sulu-sulu)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

564576.7k53](/packages/ecotone-ecotone)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)

PHPackages © 2026

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