def schedule(self):
        """Schedule or reschedule the next heartbeat."""
        if self.stopped:
            raise RuntimeError("Can't schedule stopped heartbeat")

        if self.pendingHeartbeat is None:
            self._createHeartbeatCall()
        else:
            self.pendingHeartbeat.reset(self.period)
Schedule or reschedule the next heartbeat.