Custom Message Dispatcher
You can create a custom implementation of the message dispatcher if needed. Your
class must implement the MessageDispatcher
interface:
<?php
namespace EventSauce\EventSourcing;
interface MessageDispatcher
{
public function dispatch(Message ... $messages): void;
}
It’s recommended to leverage the MessageSerializer
capabilities, just like
the custom repository does.