Skip to content

integrate with symfony messenger #56

Description

@alanbem

create generic messenger handlers for query & command bus

use Streak\Application\Command;
use Streak\Application\CommandBus;
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;

/**
 * Simple messenger adapter for Streak command bus.
 *
 * @author Alan Gabriel Bem <alan.bem@gmail.com>
 */
class CommandDispatchingHandler implements MessageHandlerInterface
{
    private CommandBus $bus;

    public function __construct(CommandBus $bus)
    {
        $this->bus = $bus;
    }

    public function __invoke(Command $command) : void
    {
        $this->bus->dispatch($command);
    }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions