How to use the neo-async.times function in neo-async

To help you get started, we’ve selected a few neo-async 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 gosquared / stash / test / stash.js View on Github external
it('many gets on uncached key from a single instance result in only one db fetch', function(done) {
      var numGets = 100;
      var fetches = 0;

      var doGet = function(n, next) {
        stash.get('hotKey', function(cb) {
          assert.equal(1, (++fetches));

          return setImmediate(function() {
            cb(null, { test: 2 });
          });
        }, next);
      };

      async.times(numGets, doGet, function(err, results) {
        assert(!err);

        assert.equal(numGets, results.length);
        done();
      });
    });
github liquidcarrot / carrot / src / neuron.cleaning.js View on Github external
"terms": ["inputs", "weights", function(results, callback) {
            async.times(results.inputs.length, function(index, callback) {
              callback(null, results.inputs[index] * results.weights[index])
            }, callback)
          }],
          "sum": ["terms", function(results, callback) {
github liquidcarrot / carrot / src / neuron.new.js View on Github external
let activate = async.seq((data, callback) => {
  async.times(i.length, (index, callback) => {
    i[index].activate(data[index], callback)
  }, callback)
}, (a, callback) => {
  async.times(h.length, (index, callback) => {
github suguru03 / neo-async / perf / func-comparator / controlFlow / sample.times.js View on Github external
'neo-async_v0': function(callback) {
    neo_async_v0.times(count, iterator, callback);
  },
  'neo-async_v1': function(callback) {