Similar to worker(), this runs the worker logic and updates the heartbeat but is designed
to be invoked by cron.  Thus, it only runs the work once.
354971
protected function cron()
    {
        $this->addLogging();
        $this->fire();
        Cache::forever($this->HEARTBEAT_WORKER_KEY, time());
    }
511867
def run(self):
        
        from zengine.wf_daemon import run_workers, Worker

        worker_count = int(self.manager.args.workers or 1)
        if not self.manager.args.daemonize:
            print("Starting worker(s)")

        if worker_count > 1 or self.manager.args.autoreload:
            run_workers(worker_count,
                        self.manager.args.paths.split(' '),
                        self.manager.args.daemonize)
        else:
            worker = Worker()
            worker.run()
543127
void heartbeat() {
        if (!clusterService.isJoined()) {
            return;
        }

        checkClockDrift(heartbeatIntervalMillis);

        final long clusterTime = clusterClock.getClusterTime();
        if (clusterService.isMaster()) {
            heartbeatWhenMaster(clusterTime);
        } else {
            heartbeatWhenSlave(clusterTime);
        }
    }
354855
private function handleHeartbeatResponse()
    {
        $state = $this->worker->getState();
        if (Worker::BUSY == $state) {
            /**
             * We should only reply in the following cases:
             * - A heartbeat is about to expire.
             * - We have a result.
             */
            return;
        }

        if (Worker::RESULT_AVAILABLE == $state) {
            // A result is available send it to the worker handler.
            $this->handleResult();

            return;
        }

        if (in_array($state, array(Worker::READY, Worker::RESULT, Worker::REGISTER))) {
            // Update the state to ready and forget about the last job.
            $this->worker->cleanup();

            // Request a new job
            $this->sendToWorkerHandler(new GetJobRequest());

            return;
        }

        if (Worker::SHUTDOWN != $state) {
            // The worker did not request a shutdown, however all other states should be handled at this point.
            $this->getLogger()->error('Invalid worker state: '.$this->worker->getState().'.');
        }

        // Worker is completely shutdown, because there is no open connection to the worker handler.
        $this->worker->setState(Worker::INVALID);
    }
1342279
function() {

		var self = Lava.Cron;
		self.onTimer();
		if (self.is_running) Firestorm.Environment.requestAnimationFrame(self.animation_frame_callback);

	}
801174
public void doHeartbeat() throws IOException {
        int curTime = TimeUtils.current_time_secs();
        WorkerHeartbeat hb = new WorkerHeartbeat(curTime, topologyId, taskIds, port);

        LOG.debug("Doing heartbeat:" + workerId + ",port:" + port + ",hb" + hb.toString());
        LocalState state = getWorkerState();
        state.put(Common.LS_WORKER_HEARTBEAT, hb);
    }
567929
def send_heartbeat(self, name):
        

        return self._loop.run_coroutine(self._client.send_heartbeat(name))
684649
def run time=nil

      puts "[cron] run called #{Time.now}" if @debug
      time = self.time if time.nil?
      self.each { |cron_job|
        ok,details = cron_job.runnable?(time)
        if ok then
          @queue.enq(cron_job)
          if cron_job.once? then
            cron_job[:delete] = true
          end
        end
      }
      self.reject! { |cron_job|
        cron_job[:delete]
      }
    end
1109664
def cron(schedule, timezone: nil)
            ms = Scheduler.parse_cron(schedule, timezone: timezone)
            event = Repeat.new(self, ms)
            event.progress &Proc.new if block_given?
            schedule(event)
            event
        end
1273281
function startWorker(triggeredByError=false){
    return new Promise(function(resolve){
        // default restart delay
        let restartDelay = 0;

        // worker restart because of died process ?
        if (triggeredByError === true){
            // increment restart counter
            _restartCounter++;
        }

        // delayed restart ?
        if (_restartCounter > 10){
            // calculate restart delay (min: 2s)
            restartDelay = 200 * _restartCounter;

            // trigger alert message
            _logger.alert(`delayed worker-restart of ${restartDelay/1000}s - number of failed processes: ${_restartCounter}`);
        }

        // trigger async fork
        setTimeout(() => {
            // create a new child process
            // note: this method RELOADS the entire js file/module! - it is NOT a classical process.fork() !
            // this allows you to hot-reload your application by restarting the workers
            const worker = _cluster.fork();

            // return worker
            resolve(worker);

        }, restartDelay);
    });
}
1312626
@Scheduled(fixedDelay = "${micronaut.heartbeat.interval:15s}",
               initialDelay = "${micronaut.heartbeat.initial-delay:5s}")
    public void pulsate() {
        ServiceInstance instance = eventReference.get();
        if (instance != null) {
            eventPublisher.publishEvent(new HeartbeatEvent(instance, currentHealthStatus.current()));
        }
    }
126179
public function planNextRun()
    {
        if ($this->is_repeating_task && !empty($this->cron_expression)) {
            $this->status = DeferredQueue::STATUS_SCHEDULED;
            $cron = CronExpression::factory($this->cron_expression);
            $this->next_start = date('Y-m-d H:i:s', $cron->getNextRunDate()->getTimestamp());
            return true;
        } else {
            return false;
        }
    }
166480
def run(self):
        
        while not self.stopped:
            now = datetime.utcnow()
            for job in self.parent.jobs:
                if not job.next_run:
                    continue
                if job.next_run >= self.last_check and job.next_run <= now:
                    if job.state.allow_start:
                        job.start()
                    else:
                        job.next_run = job.cron_iter.get_next(datetime)
            self.last_checked = now
            time.sleep(1)
386063
def start_heartbeat(self):
        
        self.stop_heartbeat()

        self._heartbeat_timer = task.LoopingCall(self._heartbeat)
        self._heartbeat_timer.start(self._heartbeat_interval, False)
187517
def _run(self):
        

        def get_next_interval():
            start_time = time.time()
            start = 0 if self.eager else 1
            for count in itertools.count(start=start):
                yield max(start_time + count * self.interval - time.time(), 0)
        interval = get_next_interval()
        sleep_time = next(interval)
        while True:
            # sleep for `sleep_time`, unless `should_stop` fires, in which
            # case we leave the while loop and stop entirely
            with Timeout(sleep_time, exception=False):
                self.should_stop.wait()
                break

            self.handle_timer_tick()

            self.worker_complete.wait()
            self.worker_complete.reset()

            sleep_time = next(interval)
1321268
def run(self):
        
        # Initialize the subscription channel.
        self.subscribe(ray.gcs_utils.XRAY_HEARTBEAT_BATCH_CHANNEL)
        self.subscribe(ray.gcs_utils.XRAY_DRIVER_CHANNEL)

        # TODO(rkn): If there were any dead clients at startup, we should clean
        # up the associated state in the state tables.

        # Handle messages from the subscription channels.
        while True:
            # Update the mapping from raylet client ID to IP address.
            # This is only used to update the load metrics for the autoscaler.
            self.update_raylet_map()

            # Process autoscaling actions
            if self.autoscaler:
                self.autoscaler.update()

            self._maybe_flush_gcs()

            # Process a round of messages.
            self.process_messages()

            # Wait for a heartbeat interval before processing the next round of
            # messages.
            time.sleep(ray._config.heartbeat_timeout_milliseconds() * 1e-3)
227844
def run(self, once=True):
        
        print("\n- Actor %s " % self.name)
        for m in self.submons:
            res = m.monitor(once=once)
            print("   | Submonitor %s : %s" % (self.name, res))
            # print("%s %s %s %s lst %s" % (self.name, m.fid, m.last, m.counter, m.last))
            self.get_kv().update(KVector.Entry(m.fid, agent=self.name, value=m.last, timestamp=m.counter))
        res = self.monitor.monitor(once=once)
        print("  Main monitor %s : %s" % (self.name, res))