infocyph/omnibus

A unified, framework-agnostic event bus and reliable message queue for PHP.

Maintainers

Package info

github.com/infocyph/Omnibus

pkg:composer/infocyph/omnibus

Transparency log

Statistics

Installs: 121

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.1 2026-08-01 05:17 UTC

This package is auto-updated.

Last update: 2026-08-01 05:54:50 UTC


README

Security & Standards Packagist Downloads License: MIT Packagist Version Packagist PHP Version GitHub Code Size Documentation

A framework-agnostic event bus and reliable message queue for PHP.

Omnibus provides one explicit lifecycle for synchronous commands, PSR-14 events, queued listeners, delayed work, durable consumers, workflows, scheduling adapters, and broadcasts. It works as a standalone Composer library and does not require a framework or command package.

Install

composer require infocyph/omnibus

Requirements:

  • PHP ^8.4
  • infocyph/uid
  • psr/clock
  • psr/event-dispatcher

DBLayer, CacheLayer, Redis/Valkey clients, and broker SDKs are optional and load only when their adapters are constructed.

Highlights

  • Explicit, cached route, handler, listener, codec, transport, and factory maps
  • Direct synchronous handlers and ordered PSR-14 events
  • In-memory, DBLayer, Redis/Valkey, AMQP, and SQS transport boundaries
  • Conditional reservation settlement and visibility-based crash recovery
  • Bounded retries, poison-payload capture, and durable failure management
  • Safe versioned JSON envelopes with allow-listed aliases and strict limits
  • CacheLayer uniqueness, overlap, rate-limit, and circuit-breaker decorators
  • Redis-free operation through DBLayer, including zero-service SQLite; Memcached may back lease-based uniqueness and overlap but is not a queue transport
  • Persistent chains and batches with idempotent terminal transitions
  • Provider-neutral scheduling, broadcasting, after-response, and telemetry
  • No filesystem scanning, hidden provider initialization, or runtime discovery

Quick start

use Infocyph\Omnibus\Envelope\HandledStamp;
use Infocyph\Omnibus\Handler\HandlerMap;
use Infocyph\Omnibus\MessageBus;
use Infocyph\Omnibus\Routing\RouteMap;
use Infocyph\Omnibus\Transport\SyncTransport;
use Infocyph\Omnibus\Transport\TransportRegistry;

$handlers = new HandlerMap([
    CreateInvoice::class => static fn (CreateInvoice $message): string =>
        $invoiceService->create($message),
]);

$bus = new MessageBus(
    new RouteMap(),
    new TransportRegistry([
        'sync' => new SyncTransport($handlers),
    ]),
);

$result = $bus->dispatch(new CreateInvoice($accountId));
$invoiceId = $result->last(HandledStamp::class)?->result;

Route selected messages asynchronously without changing the message or business handler:

use Infocyph\Omnibus\Routing\Route;
use Infocyph\Omnibus\Routing\RouteMap;

$routes = new RouteMap([
    CreateInvoice::class => new Route(
        transport: 'redis',
        queue: 'billing',
        delaySeconds: 2.0,
    ),
]);

Consumer::run() performs one bounded receive call. Any application loop, scheduler, process manager, or CLI can invoke it directly.

Delivery semantics

Durable transports provide at-least-once delivery. Terminal failures are persisted before rejection, stale receipts cannot settle reclaimed work, and telemetry failures cannot change queue or handler outcomes. Handlers that produce durable side effects must remain idempotent.

Quality checks

composer ic:tests
composer ic:ci
composer benchmark
composer soak:consumer
composer soak:durable

Documentation

Read the complete Omnibus documentation, including getting started, real-world examples, queue semantics, durable backends, serialization security, workflows, and operations.

Security

Protected by PHPForge, the automated quality and security gate used across Infocyph PHP libraries.

Made with ❤️ for the PHP community
MIT Licensed
DocumentationSecurityCode of ConductContributingReport BugRequest Feature