/**
  * @param object $command
  * @param callable $next
  *
  * @return mixed
  */
 public function execute($command, callable $next)
 {
     $next($command);
     $unncommitedEventStreams = [];
     foreach ($this->streamNames as $streamName) {
         $unncommitedEventStreams[] = $this->eventStore->findUncommited(new EventStream\Name($streamName));
     }
     $this->eventStore->commit();
     foreach ($unncommitedEventStreams as $eventStream) {
         $this->eventBus->notify($eventStream);
     }
 }