public function isHeartbeatNeeded($id) { if (!$this->existsConnection($id)) { return true; } return $this->validateOut($this->generateConst(), $this->getConnection($id)); }
/** * @param string $id * @return bool */ private function heartbeat($id) { if ($this->connectionPool->isHeartbeatNeeded($id) === true) { return $this->sendMessage($id, self::COMMAND_HEARTBEAT); } return false; }