Lightweight and unrestrictive Message Bus implementation for PHP 7.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
src
test
.gitattributes
.gitignore
.travis.yml
CHANGELOG.md
LICENSE
README.md
build.xml
composer.json
composer.lock
phpunit.xml

README.md

Messager

Latest Version Build Status Software License

Messager is a lightweight and unrestrictive internal messaging framework for PHP 7.

It can be used in Event-Driven applications to build more specialized components like Command Bus or Event Dispatcher.

System Requirements

PHP 7.1 or later.

Install

Install using Composer:

$ composer require maximegosselin/messager

Messager is registered under the MaximeGosselin\Messager namespace.

Documentation

Usage overview

use MaximeGosselin\Messager\MessageBus;

// Create a message bus with a core message handler
$bus = new MessageBus(new MyApp\MyMessageHandler());

// Push a middleware to the stack
$bus = $bus->withMiddleware(new MyApp\MyMiddleware());

// Send a message
$bus->handle(new MyApp\MyMessage());

Examples

See /examples for real-world implementation examples.

Tests

Run the following command from the project folder.

$ vendor/bin/phpunit

License

The MIT License (MIT). Please see LICENSE for more information.