How to use timers - 10 common examples

To help you get started, we’ve selected a few timers 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 Raynos / mercury / examples / async-state.js View on Github external
function App() {
    var state = hg.state({
        isUpdated: hg.value(false)
    });
    // Arrange for state to be updated asynchronously
    setTimeout(function updateState() {
        state.isUpdated.set(true);
    }, 2000);
    return state;
}
github uber-archive / hyperbahn / test / register / register-with-slow-affinity.js View on Github external
function sendNext() {
        if (--counter === 0) {
            return setTimeout(invokeCb, 500);
        }

        cluster.sendRegister(dummy, {
            serviceName: 'hello-bob',
            host: exitNodes[0].hostPort,
            timeout: 500
        }, onError);

        setTimeout(sendNext, 50);
    }
github uber-archive / hyperbahn / test / health.js View on Github external
function onResponse(err, resp) {
        assert.ifError(err);

        assert.equal(resp.body, 'hello from autobahn\n');

        setTimeout(function flush() {
            app.clients.batchStats.flushStats();
            setTimeout(finish, 500);
        }, 500);
    }
github QTGate / QTGate-Desktop-Client / app / imap.js View on Github external
const doCallBack = (err, ret) => {
        if (!callbackCall) {
            console.trace('imapAccountTest doCallBack');
            saveLog(`imapAccountTest doing callback err [${err && err.messgae ? err.messgae : `undefine `}] ret [${ret ? ret : 'undefine'}]`);
            callbackCall = true;
            timers_1.clearTimeout(timeout);
            return CallBack(err, ret);
        }
    };
    let rImap = new qtGateImapRead(IMapConnect, listenFolder, false, mail => {
github apigee / trireme / node12 / node12src / src / main / javascript / io / apigee / trireme / node12 / node / net.js View on Github external
Socket.prototype._unrefTimer = function unrefTimer() {
  for (var s = this; s !== null; s = s._parent)
    timers._unrefActive(s);
};
github feross / chrome-net / index.js View on Github external
Socket.prototype._unrefTimer = function unrefTimer () {
  for (var s = this; s !== null; s = s._parent) {
    timers._unrefActive(s)
  }
}
github weolar / miniblink49 / node / lib / net.js View on Github external
Socket.prototype._unrefTimer = function _unrefTimer() {
  for (var s = this; s !== null; s = s._parent)
    timers._unrefActive(s);
};
github pmq20 / node-packer / node / lib / net.js View on Github external
Socket.prototype._unrefTimer = function _unrefTimer() {
  for (var s = this; s !== null; s = s._parent)
    timers._unrefActive(s);
};
github nodekit-io / nodekit-darwin / src / nodekit / NKCore / lib-core / node / net.js View on Github external
Socket.prototype._unrefTimer = function unrefTimer() {
  for (var s = this; s !== null; s = s._parent)
    timers._unrefActive(s);
};

timers

A tiny cron-like tools for humman.

MIT
Latest version published 11 years ago

Package Health Score

50 / 100
Full package analysis

Similar packages