PHPackages                             micro-module/saga - 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. micro-module/saga

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

micro-module/saga
=================

Micro module Saga common library

v0.7.0(2mo ago)03.6k↑142.9%3proprietaryPHPPHP ^8.0CI failing

Since Apr 24Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/temafey/micro_modules_saga_ext)[ Packagist](https://packagist.org/packages/micro-module/saga)[ RSS](/packages/micro-module-saga/feed)WikiDiscussions master Synced today

READMEChangelog (7)Dependencies (28)Versions (14)Used By (3)

micro-module/saga
=================

[](#micro-modulesaga)

Micro-module saga extension library. Provides abstract saga base class, DBAL saga repository, and command dispatching infrastructure following the Dependency Inversion Principle.

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

[](#installation)

```
composer require micro-module/saga
```

Dispatcher Interfaces
---------------------

[](#dispatcher-interfaces)

### SagaCommandDispatcherInterface

[](#sagacommanddispatcherinterface)

Abstraction for dispatching commands from within sagas. Two implementations are provided:

- `SyncSagaCommandDispatcher` — dispatches synchronously via Tactician `CommandBus`
- `OutboxSagaCommandDispatcher` — enqueues asynchronously via `SagaCommandQueueInterface`

### SagaCommandQueueInterface

[](#sagacommandqueueinterface)

Abstract queue contract. The saga package does NOT depend on `outbox-bundle` or any concrete queue implementation. The outbox package (or any other package) implements this interface and is wired via DI.

Dependency Inversion Diagram
----------------------------

[](#dependency-inversion-diagram)

```
                    saga package
                 ┌───────────────────────────────────────────────┐
                 │                                               │
                 │  SagaCommandDispatcherInterface               │
                 │          ▲              ▲                     │
                 │          │              │                     │
                 │  OutboxSaga-    SyncSaga-                     │
                 │  CommandDispatcher   CommandDispatcher        │
                 │          │              │                     │
                 │  SagaCommandQueueInterface   CommandBus       │
                 │          │              │                     │
                 └──────────┼──────────────┼─────────────────────┘
                            │              │
                 ┌──────────┼──────────────┼─────────────────────┐
                 │          │              │  outbox-bundle /     │
                 │  OutboxAwareTaskProducer    tactician-bundle   │
                 │  implements SagaCommandQueueInterface          │
                 └───────────────────────────────────────────────┘

```

**Key rule:** The arrow from `OutboxAwareTaskProducer` points TO the saga package interface — the saga package has zero dependency on the outbox package. This is the Dependency Inversion Principle in action.

Usage
-----

[](#usage)

### Sync dispatch (Tactician)

[](#sync-dispatch-tactician)

```
// DI wiring
$dispatcher = new SyncSagaCommandDispatcher($commandBus);
$dispatcher->dispatch(new CreateNewsCommand($id));
```

### Async dispatch via outbox (DIP)

[](#async-dispatch-via-outbox-dip)

```
// The queue implementation (OutboxAwareTaskProducer) lives in outbox-bundle
// and implements SagaCommandQueueInterface.
// Wire via DI alias — never hard-code the concrete class in your saga.

$dispatcher = new OutboxSagaCommandDispatcher($queue); // $queue is SagaCommandQueueInterface
$dispatcher->dispatch(new PublishNewsCommand($id));    // command must implement Serializable
```

Requirements
------------

[](#requirements)

- PHP 8.0+
- `league/tactician` ^1.0
- `micro-module/broadway` ^2.6 (provides `Broadway\Serializer\Serializable`)

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance84

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.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 ~242 days

Recently: every ~356 days

Total

10

Last Release

82d ago

PHP version history (3 changes)v0.4.0PHP ^7.3

v0.5.0PHP ^7.3 || ^8.0

v0.6.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/bb0e6b6ff14b9d53d413617c42ddb1f83ff451c32beac02bc4ebebb6cfabeb00?d=identicon)[temafey](/maintainers/temafey)

---

Top Contributors

[![temafey](https://avatars.githubusercontent.com/u/981101?v=4)](https://github.com/temafey "temafey (8 commits)")[![andreysox](https://avatars.githubusercontent.com/u/135994711?v=4)](https://github.com/andreysox "andreysox (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Code StyleECS

Type Coverage Yes

### Embed Badge

![Health badge](/badges/micro-module-saga/health.svg)

```
[![Health](https://phpackages.com/badges/micro-module-saga/health.svg)](https://phpackages.com/packages/micro-module-saga)
```

###  Alternatives

[bornfreee/tactician-domain-events

A Plugin for Tactician command bus library to work with the recorded Domain Events

25195.9k1](/packages/bornfreee-tactician-domain-events)[concrete5/core

Concrete core subtree split

20166.1k52](/packages/concrete5-core)[api-clients/command-bus

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

11198.0k4](/packages/api-clients-command-bus)[jildertmiedema/laravel-tactician

Tactician for laravel 8+

105.0k](/packages/jildertmiedema-laravel-tactician)

PHPackages © 2026

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