scan quorums for heartbeat-aware and ping-aware implementations and set corresponding flags
498802
private void scanQuorums() {
        for (QuorumImpl quorum : quorums.values()) {
            if (quorum.isHeartbeatAware()) {
                this.heartbeatAware = true;
            }
            if (quorum.isPingAware()) {
                this.pingAware = true;
            }
        }
    }
628270
private void checkHeartbeatTimeout(PropertyKey intervalKey, PropertyKey timeoutKey) {
    long interval = getMs(intervalKey);
    long timeout = getMs(timeoutKey);
    Preconditions.checkState(interval < timeout,
        "heartbeat interval (%s=%s) must be less than heartbeat timeout (%s=%s)", intervalKey,
        interval, timeoutKey, timeout);
  }
969558
def _run(self):
        
        tup = self.read_tuple()
        self._current_tups = [tup]
        if self.is_heartbeat(tup):
            self.send_message({"command": "sync"})
        elif self.is_tick(tup):
            self.process_tick(tup)
            if self.auto_ack:
                self.ack(tup)
        else:
            self.process(tup)
            if self.auto_ack:
                self.ack(tup)
        # Reset _current_tups so that we don't accidentally fail the wrong
        # Tuples if a successive call to read_tuple fails.
        # This is not done in `finally` clause because we want the current
        # Tuples to fail when there is an exception.
        self._current_tups = []
1141788
def _service_heartbeat_if_due(self):
        ''''''
        due = False
        if self._service_registry:
            if not hasattr(self, "status_info"):
                due = True
            else:
                d = doublethink.utcnow() - self.status_info["last_heartbeat"]
                due = d.total_seconds() > self.HEARTBEAT_INTERVAL

        if due:
            self._service_heartbeat()
933765
void onHeartbeat(Member member, long timestamp) {
        if (!heartbeatAwareQuorumFunction) {
            return;
        }
        ((HeartbeatAware) quorumFunction).onHeartbeat(member, timestamp);
    }
76330
private void sendHeartbeatIfNeeded() {
		final long nextHeartbeat = lastHeartbeatSupplier.get() + HEARTBEAT;

		if(nextHeartbeat < System.currentTimeMillis()) {
			logger.debug("Send heartbeat");
			bitfinexApiBroker.sendCommand(new PingCommand());
		}
	}
1329110
async def _heartbeat_callback(self):
        """"""
        query = {
            "MPRPC": self.VERSION,
            "HEARTBEAT": "ping"
        }
        queryb = self.encoder(query)
        while True:
            await asyncio.sleep(self.heart_beat)
            self.writer.write(queryb)
            if self.debug is True:
                print("ping")
514224
def handle_heartbeat_response(msg):
    """"""
    if not msg.gateway.is_sensor(msg.node_id):
        return None
    handle_smartsleep(msg)
    msg.gateway.sensors[msg.node_id].heartbeat = msg.payload
    msg.gateway.alert(msg)
    return None
260901
private void gossip() {
    // Check suspect nodes for failure timeouts.
    checkFailures();

    // Check local metadata for changes.
    checkMetadata();

    // Copy and clear the list of pending updates.
    if (!updates.isEmpty()) {
      List<ImmutableMember> updates = Lists.newArrayList(this.updates.values());
      this.updates.clear();

      // Gossip the pending updates to peers.
      gossip(updates);
    }
  }
786797
function Swarm (infoHash, server) {
  var self = this
  self.infoHash = infoHash
  self.complete = 0
  self.incomplete = 0

  self.peers = new LRU({
    max: server.peersCacheLength || 1000,
    maxAge: server.peersCacheTtl || 20 * 60 * 1000 // 20 minutes
  })

  // When a peer is evicted from the LRU store, send a synthetic 'stopped' event
  // so the stats get updated correctly.
  self.peers.on('evict', function (data) {
    var peer = data.value
    var params = {
      type: peer.type,
      event: 'stopped',
      numwant: 0,
      peer_id: peer.peerId
    }
    self._onAnnounceStopped(params, peer, peer.peerId)
    peer.socket = null
  })
}
270590
def _send_heartbeat_request(self):
        """"""
        if self.coordinator_unknown():
            e = Errors.GroupCoordinatorNotAvailableError(self.coordinator_id)
            return Future().failure(e)

        elif not self._client.ready(self.coordinator_id, metadata_priority=False):
            e = Errors.NodeNotReadyError(self.coordinator_id)
            return Future().failure(e)

        version = 0 if self.config['api_version'] < (0, 11, 0) else 1
        request = HeartbeatRequest[version](self.group_id,
                                            self._generation.generation_id,
                                            self._generation.member_id)
        log.debug("Heartbeat: %s[%s] %s", request.group, request.generation_id, request.member_id)  # pylint: disable-msg=no-member
        future = Future()
        _f = self._client.send(self.coordinator_id, request)
        _f.add_callback(self._handle_heartbeat_response, future, time.time())
        _f.add_errback(self._failed_request, self.coordinator_id,
                       request, future)
        return future
1075520
function Polling(opts) {
  var forceBase64 = opts && opts.forceBase64;
  if (!hasXHR2 || forceBase64) {
    this.supportsBinary = false;
  }
  transport.call(this, opts);
}
256084
function broadcastMonitors(records, moduleId, msg) {
    msg = protocol.composeRequest(null, moduleId, msg);

    if (records instanceof Array) {
        for (let i = 0, l = records.length; i < l; i++) {
            const socket = records[i].socket;
            doSend(socket, 'monitor', msg);
        }
    } else {
        for (const id in records) {
            if (records.hasOwnProperty(id)) {
                const socket = records[id].socket;
                doSend(socket, 'monitor', msg);
            }
        }
    }
}
56373
public void setHeartbeatInterval(short heartbeatInterval)
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setHeartbeatInterval");
      properties.put(HEARTBEAT_INTERVAL, heartbeatInterval);
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setHeartbeatInterval", ""+heartbeatInterval);
   }
1365543
void hubHeartbeat(UpdateServerHeartbeat updateServer,
                    UpdateRackHeartbeat updateRack,
                    UpdatePodSystem updatePod,
                    long sequence)
  {
    if (startUpdate(updateRack, updatePod)) {
      getHeartbeat().hubHeartbeat(updateServer, updateRack, updatePod, sequence);
    }
  }
750374
async def post_heartbeat(self, msg, _context):
        """"""

        name = msg.get('name')

        await self.service_manager.send_heartbeat(name)
1201010
public void hubHeartbeat(UpdateServerHeartbeat updateServer, 
                           UpdateRackHeartbeat updateRack,
                           UpdatePodSystem updatePod,
                           long sourceTime)
  {
    RackHeartbeat rack = getCluster().findRack(updateRack.getId());
    
    
    if (rack == null) {
      rack = getRack();
    }
    
    updateRack(updateRack);
    
    updateServerStart(updateServer);
    
    // XXX: _podService.onUpdateFromPeer(updatePod);
    
    // rack.update();
    
    updateTargetServers();

    PodHeartbeatService podHeartbeat = getPodHeartbeat();
    
    if (podHeartbeat != null && updatePod != null) {
      podHeartbeat.updatePodSystem(updatePod);
    }
    
    _joinState = _joinState.onHubHeartbeat(this);
    
    // updateHubHeartbeat();
    updateHeartbeats();
  }