zcfs:micro-queue 
Looking for maintainers - please reach out!
This package is to be archived due to inability to find contributors, thanks to everyone who helped make it possible.
If you're looking for an alternative, we highly recommend Meteor-Files by VeliovGroup
MicroQueue is a simple LIFO or FIFO queue. It's faster than a simple array with pop
/shift
because shift
is O(n)
and can become slow with a large array.
This queue was built as a spinal-queue for the PowerQueue
package. The interface is very basic and consists of add
, get
, and reset
, making it possible to write a custom micro-queue for PowerQueue
, such as a queue that is persisted into a database.
Note: MicroQueue can be used with
PowerQueue
butMicroQueue
lacks the properties of n key ordered list - It does try to compensate when reinserting keys - this is especially optimized for the PowerQueue
And... It's powered by Meteor's reactive sugar :)
Kind regards Eric(@aldeed) and Morten(@raix)
Happy coding!!
#API API Documentation
From the docs:
new MicroQueue([lifo]) Anywhere
Arguments
- lifo {boolean} (Optional = false)
Set true for lifo
, default is fifo
Usage:
1var foo = new MicroQueue(); // Basic FIFO queue 2foo.add(1); 3foo.add(2); 4foo.add(3); 5for (var i = 0; i < foo.length(); i++) { 6 console.log(foo.get()); 7}
The result should be: "1, 2, 3".
MicroQueue = function(lifo) { ...
See micro-queue.js:24.
Contribute
Here's the complete API documentation, including private methods.
To update the docs, run npm install docmeteor
then
$ docmeteor