/** * Checks if workers are still valid. * * @param string $heartbeatAt * @return mixed|string */ public function validateQueue($heartbeatAt) { if (microtime(true) > $heartbeatAt) { $this->queue->rewind(); while ($this->queue->valid()) { $message = new MultipartMessage($this->workerChannel); $message->setBody("HEARTBEAT"); $message->wrap($this->queue->key(), null); $message->send(); $this->queue->next(); } $heartbeatAt = microtime(true) + $this->config->getInterval(); } $this->queue->purgeQueue(); return $heartbeatAt; }