Kraken\Channel\Model\Socket\Socket::startHeartbeat PHP Метод

startHeartbeat() приватный Метод

Heartbeat mechanisms is used to identify online and offline sockets.
private startHeartbeat ( )
    private function startHeartbeat()
    {
        if ($this->hTimer === null && $this->flags['enableHeartbeat']) {
            $this->clearConnectionPool();
            $proxy = $this;
            $this->hTimer = $this->loop->addPeriodicTimer($this->options['heartbeatInterval'] / 1000, function () use($proxy) {
                if ($proxy->type === Channel::CONNECTOR) {
                    foreach ($proxy->hosts as $hostid) {
                        $proxy->heartbeat($hostid);
                    }
                }
                $this->clearConnectionPool();
            });
        }
    }