/** * {@inheritdoc} This dispatcher defers worker timeout to post-dispatch. * * @return void */ public function run() { if ($this->manager->count() >= $this->max_workers) { $this->manager->wait(); } elseif ($this->queue->count()) { $this->dispatch($this->queue->pop()); } }
public function run() { $this->setProcessTitle('running'); $this->parseCommandLine(); $this->demonize(); $this->runChilds(); $this->setProcessTitle('idle'); $this->processManager->wait(); $this->exitApp(self::SUCCESS_EXIT); }
public function testReSpawnedProcessHasPersistSharedMemorySegment() { $process = $this->manager->spawn(function (Process $p) { $sm = $p->getSharedMemory(); $sm['spawnCount'] += 1; $exitCode = $sm['spawnCount'] == 1 ? -1 : 0; exit($exitCode); }); $this->manager->wait(); $this->assertEquals(2, $process->getSharedMemory()['spawnCount']); }