How to use the long-timeout.setTimeout function in long-timeout

To help you get started, we’ve selected a few long-timeout examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Picolab / pico-engine / packages / pico-engine-core / src / Scheduler.js View on Github external
pendingAtRemoves--
          if (err) conf.onError(err)
          update()// check the schedule for the next
        })

        // emit the scheduled job
        conf.onEvent(next.event)
      }

      if (conf.is_test_mode) {
        // in test mode they manually trigger execution of currTimeout
        currTimeout = onTime
      } else {
        // Execute the event by milliseconds from now.
        // If it's in the past it will happen on the next tick
        currTimeout = lt.setTimeout(onTime, next.at.getTime() - Date.now())
      }
    })
  }
github rstacruz / cron-scheduler / index.js View on Github external
function schedule () {
    var future = next()
    var delta = Math.max(future.diff(moment()), 1000)

    debug(name + ': next run in ' + ms(delta) +
      ' at ' + future.format('llll Z'))

    if (timer) lt.clearTimeout(timer)
    timer = lt.setTimeout(run, delta)
  }
github sx1989827 / DOClever / node_modules / node-schedule / lib / schedule.js View on Github external
function runOnDate(date, job) {
  var now = Date.now();
  var then = date.getTime();
  
  return lt.setTimeout(function() {
    if (then > Date.now())
      runOnDate(date, job);
    else
      job();
  }, (then < now ? 0 : then - now));
}
github ILIAS-eLearning / ILIAS / Modules / Chatroom / chat / node_modules / node-schedule / lib / schedule.js View on Github external
function runOnDate(date, job) {
  var now = Date.now();
  var then = date.getTime();

  return lt.setTimeout(function() {
    if (then > Date.now())
      runOnDate(date, job);
    else
      job();
  }, (then < now ? 0 : then - now));
}

long-timeout

Long timeout makes it possible to have a timeout or interval that is longer than 24.8 days (2^31-1 milliseconds).

MIT
Latest version published 9 years ago

Package Health Score

65 / 100
Full package analysis