/** * Remove dead process pids from redis set. * * @param \ARedisSet $pool * @return integer amount of dead pids */ protected function checkPidPool(\ARedisSet $pool) { $removed = 0; $pids = $pool->getData(true); foreach ($pids as $pid) { if ($this->isPidAlive($pid)) { continue; } $pool->remove($pid); $removed++; } return $removed; }