コード例 #1
0
 /**
  * Register event listeners.
  *
  * @return void
  */
 protected function listen()
 {
     $this->eventEmitter->on('peridot.concurrency.pool.start-workers', [$this, 'onWorkersStart']);
     $this->eventEmitter->on('peridot.concurrency.worker.error', [$this, 'onError']);
     $broker = $this->pool->getMessageBroker();
     $broker->on('suite.start', [$this, 'onSuiteStart']);
     $broker->on('suite.end', [$this, 'onSuiteEnd']);
     $broker->on('test.passed', [$this, 'onTestPassed']);
     $broker->on('test.failed', [$this, 'onTestFailed']);
     $broker->on('test.pending', [$this, 'onTestPending']);
 }
コード例 #2
0
 /**
  * Listen for start of workers.
  *
  * @param WorkerPoolInterface $pool
  * @return void
  */
 public function onWorkersStart(WorkerPoolInterface $pool)
 {
     $workers = $pool->getWorkers();
     $count = count($workers);
     $this->eventEmitter->emit('peridot.concurrency.stream-select.start', [$count]);
 }