protected function setupHeartbeat($interval)
    {
        $this->heartbeatInterval = $interval;
        if (isset($this->heartbeatTimer)) {
            $this->heartbeatTimer->cancel();
        }

        $interval             = $interval / 1000;
        $this->heartbeatTimer = $this->loop->addPeriodicTimer($interval, [$this, 'heartbeat']);
        $this->heartbeat();

        $this->logger->info('heartbeat timer initilized', ['interval' => $interval * 1000]);
    }
protected function setupHeartbeat($interval)
    {
        $this->heartbeatInterval = $interval;
        if (isset($this->heartbeatTimer)) {
            $this->heartbeatTimer->cancel();
        }

        $interval             = $interval / 1000;
        $this->heartbeatTimer = $this->loop->addPeriodicTimer($interval, [$this, 'heartbeat']);
        $this->heartbeat();

        $this->logger->info('heartbeat timer initilized', ['interval' => $interval * 1000]);
    }
protected function setupHeartbeat ( $ interval ) { $ this -> heartbeatInterval = $ interval ; if ( isset ( $ this -> heartbeatTimer ) ) { $ this -> heartbeatTimer -> cancel ( ) ; } $ interval = $ interval / 1000 ; $ this -> heartbeatTimer = $ this -> loop -> addPeriodicTimer ( $ interval , [ $ this , 'heartbeat' ] ) ; $ this -> heartbeat ( ) ; $ this -> logger -> info ( 'heartbeat timer initilized' , [ 'interval' => $ interval * 1000 ] ) ; }
Sets the heartbeat timer up.

@param int $interval The heartbeat interval in milliseconds.
Sets the heartbeat timer up .