MemQueue
Description
This NodeJs library is an implementation of queue with memcached.
Installation
npm install memqueue
Usage
var MemQueue = ; console;try // create a new queue var queue = "myqueue" 'localhost:11213'; catch e console; var element = "element"+Math; console;// push an element into the queue.queue;
Methods
Kind: global class
Api: public
new MemQueue(key, locations, options)
Constructor
Param | Type | Description |
---|---|---|
key | Mixed |
Key String or Number |
locations | Mixed |
Array, string or object with servers |
options | Object |
Options |
void
push(value, lifetime, callback) ⇒ Push
Stores a new value in Memqueue.
Emits: push
Api: public
Param | Type | Description |
---|---|---|
value | Mixed |
Either a buffer, JSON, number or string that you want to store. |
lifetime | Number |
how long the data needs to be stored measured in seconds |
callback | function |
the callback |
void
pop(callback) ⇒ Pop
Retrieve Last value from memqueue.
Emits: pop
, empty
Api: public
Param | Type | Description |
---|---|---|
callback | function |
the callback |
void
end() ⇒ End
Finish memcached connection.
Api: public
For more information see Documentation
License
The driver is released under the GPL-3.0 license. See the LICENSE for more information.