/** * 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']); }
/** * 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]); }