Skip to content

Repository files navigation

Command Bus

This is easy to use PHP command bus implementation.

VersionTotal DownloadsPhpLicenseBuild Status

Installation

The preferred way to install this extension is through composer.

Either run

composer require onliner/command-bus:^0.1.0

or add this code line to the require section of your composer.json file:

"onliner/command-bus": "^0.1.0"

Usage

useOnliner\CommandBus\Builder;
class Hello
{
public$message;
publicfunction__construct(string$message)
{
$this->message = $message;
}
}
$dispatcher = (newBuilder())
->handle(Hello::class, function (Hello$command) {
echo'Hello ' . $command->message;
})
->build();
$dispatcher->dispatch(newHello('onliner'));

More examples can be found here.

License

Released under the MIT license.

About

A simple, focused command bus for PHP with first-class AMQP support. Built to help you implement asynchronous messaging patterns without overengineering.

Topics

Resources

Stars

7 stars

Watchers

8 watching

Forks

Releases

Packages

Used by

Contributors

Languages