Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save AoJ/987c0aa8a51463ee67e0 to your computer and use it in GitHub Desktop.

Select an option

Save AoJ/987c0aa8a51463ee67e0 to your computer and use it in GitHub Desktop.
(function () {
"use strict";
var fs = require('fs'),
iterations = 0,
work = function (callback) {
var buffer = '',
i;
console.log('Work ' + iterations);
for (i = 0; i < 50; i += 1) {
//wget https://gist.githubusercontent.com/AoJ/79046572cbc028daab65/raw/4be557ed63be643afaf898197f7dcbabb37630f1/words
buffer += fs.readFileSync('./words');
}
iterations += 1;
if (iterations < 100) {
// buffer = null;
// process.nextTick(function () {
work(callback);
// });
} else {
callback();
}
};
work(function () {
console.log('Done');
});
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment