This is a Disqueue client using node.js.
Install Disque
Connect to disqueue then you can use the connected disqueue( examples )
ADDJOB
disqueue.addJob( {
'queue', <queue>,
'job' : <job>,
'timeout' : <ms-seconds>, // optional defaults to 0
'replicate' : <count>, // optional
'delay' : <seconds>, // optional
'retry' : <seconds>, // optional
'ttl' : <seconds>, // optional
'maxlen' : <count>, // optional
'async' : <true> // optional
}, callback )
GETJOB
disqueue.getJob( {
'queue', <queue>, // can be a string or an array of queues
'count' : <count>,
'nohang' : <true> // Optional defaults to false
}, callback )
FASTACK
disqueue.fastAck( <ARRAY of IDS|STRING of the ID>, callback );
ACKJOB
disqueue.ackJob( <ARRAY of IDS|STRING of the ID>, callback );
To connect to disque just add password
'use strict';
var options = {
'auth' : {
'password' : 'gideonairex'
}
};
var disqueue = new Disqueue( options );
diqueue.on( 'connected', function () {
} );
Or you just add options and use the default port and host
'use strict';
var options = {
'host' : '127.0.0.1',
'port' : 7777,
'auth' : {
'password' : 'gideonairex'
}
};
var disqueue = new Disqueue( options );
diqueue.on( 'connected', function () {
} );
'use strict'
var Disqueue = require( 'disqueue-node' );
var disqueue = new Disqueue();
diqueue.on( 'connected', function () {
disqueue.addJob( {
'queue' : 'test',
'job' : 'hello world'
}, function ( error, addJobResult ) {
} );
} );
npm test
npm run lint
- Complete all commands
- Benchmark