tim

timedqueue

a generic object queue with timeout calculated as num_obj_in_the_queue*millisec, emitting flush event when timeout is fired

Showing:

Popularity

Downloads/wk

2

Maintenance

No Maintenance Data Available

Package

Dependencies

0

Size (min+gzip)

0.5KB

License

BSD-2-Clause

Type Definitions

Tree-Shakeable

No?

Categories

Readme

A generic object queue with timeout calculated as num_obj_in_the_queue*millisec, emitting flush event when timeout is fired Subscribe to "flush" event to get notified when the queue needs to be emptied. Invoke terminate() method to unsubscribe and delete the queue, after emptying.

Usage:

var myqueue = new TimedQueue({id:"myqueueid", interval:500, multiplier:1000,debug:true}); // debug parameter is optional myqueue.on("flush", function(flushed) { console.log("received flush array: " + JSON.stringify(flushed)); });

myqueue.push("msg1"); // you can push any object type

setTimeout(function(){ myqueue.terminate(); }, 10000);

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100