node-curl/examples/pressure.js
2013-05-25 16:00:35 +08:00

38 lines
796 B
JavaScript

// Generated by ToffeeScript 1.6.2-5
(function() {
var Curl, assert, i, j, next, _fn, _i;
Curl = require('../index');
assert = require('assert');
j = 0;
(next = function() {
console.info("curl instances: ", Curl.get_count());
return setTimeout(next, 1000);
})();
_fn = function() {
var curl, once;
curl = Curl.create();
return (once = function() {
var err, res,
_this = this;
curl('localhost/test.html', function() {
err = arguments[0], res = arguments[1];
assert.equal(res.body.length, 1468);
if (++j % 100 === 0) {
console.info(j);
}
if (j < 500000) {
return once();
}
});
})();
};
for (i = _i = 1; _i <= 100; i = ++_i) {
_fn();
}
}).call(this);