/**
  * @param JobSettings $settings
  * @param UuidInterface $previousEventId
  * @return Generator
  */
 private function createEventPublicationProcess(JobSettings $settings, UuidInterface $previousEventId) : Generator
 {
     $this->eventStream = $settings->createEventStream($this->container, $previousEventId);
     $eventBus = $settings->getEventBus($this->container);
     return $eventBus->publishFromStream($this->eventStream);
 }
Exemple #2
0
 public function run(JobExecutor $jobExecutor, RunJob $command = null)
 {
     $settings = $command ? $this->settings->override($command) : $this->settings;
     $previousEventId = $command ? $command->getPreviousEventId() : null;
     $jobExecutor->run($this->name, $settings, $previousEventId);
 }