1

bundle-bus/eventhub-craft

This repository provides a set of classes that integrate the Symfony Messenger component with your application's event and command buses.

It includes implementations for both event publishing and command dispatching, leveraging the Symfony Messenger infrastructure to manage asynchronous messaging and event handling.

Install

composer require bundle-bus/eventhub-craft

Usage

 $handler = new SumCommandHandler();
 
        $messageBusInterface = new MessageBus([
            new HandleMessageMiddleware(new HandlersLocator([
                SumCommand::class => [$handler],
            ])),
        ]);
        $CommandBus = new SymfonyCommandBus($messageBusInterface);
 
        $responseSum = $CommandBus->dispatch(new SumCommand(...[1, 2, 3]));