2017 © Pedro Peláez
 

library silex-simple-bus-provider

Silex Provider for Command bus and Event bus Features with the SimpleBus/MessageBus

image

disasterdrop/silex-simple-bus-provider

Silex Provider for Command bus and Event bus Features with the SimpleBus/MessageBus

  • Friday, September 1, 2017
  • by disasterdrop
  • Repository
  • 1 Watchers
  • 0 Stars
  • 272 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 22 % Grown

The README.md

Readme

By Sebastian Hübner, (*1)

This is an Silex Provider for the SimpleBus/MessageBus by Matthias Noback, (*2)

With this Provider you can register new Events and CommandHandlers within your silex application., (*3)

Event Bus

Register Event Bus

$app->register(new \Disasterdrop\SimpleBusProvider\Provider\EventBusProvider());

Add Subscriber to the Event Bus

// Event Bus
$app['eventSubscribers'] = function ($app) {
    $subscribers = [
        SomeEventHappens::class => [
            function ($message) use ($app) {
                $eventSubscriber = new SomeEventHappens($app['someService']);
                return $eventSubscriber->notify($message);
            }
        ]
    ];
    return $subscribers;
};

Command Handler

Register Command Handler

$app->register(new Disasterdrop\SimpleBusProvider\Provider\CommandBusProvider());

Add Handlers to the Command Bus

// Command Bus
$app['commandHandlers'] = function ($app) {
    $handlers = [
        SomeCommand::class => function ($command) use ($app) {
            $commandHandler = new SomeCommandHandler($app['pollWriteRepository'], $app['eventBus']);
            return $commandHandler->handle($command);
        },
    ];
    return $handlers;
};

The Versions

01/09 2017

dev-master

9999999-dev

Silex Provider for Command bus and Event bus Features with the SimpleBus/MessageBus

  Sources   Download

MIT

The Requires

 

silex commands events commandbus simplebus eventbus messagebus

01/09 2017

v1.0

1.0.0.0

Silex Provider for Command bus and Event bus Features with the SimpleBus/MessageBus

  Sources   Download

MIT

The Requires

 

silex commands events commandbus simplebus eventbus messagebus