0.1.0 • Published 11 years ago

slowloris v0.1.0

Weekly downloads
8
License
-
Repository
github
Last release
11 years ago

Slow Loris

Slow Loris is a small library to queue events and bulk process them in a specified interval

How to use

var Limiter = require("slowloris").Limiter;

var startTime = new Date().getTime(),
    counter = 0;

var l = new Limiter(500, function (d) {
    var now = new Date().getTime();
    console.log((now - startTime) + ": [" + d.queue.length + "] " + d.last);
    startTime = now;
});

var inter = setInterval(function () {
    l.event(counter);
    counter += 1;
    if (counter > 1200) {
        clearInterval(inter);
    }
}, 10);