An open API service indexing awesome lists of open source software.

https://github.com/optimalbits/resultqueue

Result queue on top of bull
https://github.com/optimalbits/resultqueue

Last synced: 12 months ago
JSON representation

Result queue on top of bull

Awesome Lists containing this project

README

          

# resultqueue
Result queue on top of bull

```js
const {
Client,
Server
} = require('../');

const redis = {
host: 'localhost',
port: '6379'
};

const server = new Server('test-queue', redis);
const client = new Client('test-queue', 'id', redis);

server.processJob(data => {
console.log('Sever processing job', data);

return {val: data.val + 1};
});

client.processResult(result => {
console.log('Client got result', result);

// free resources
client.destroy();
server.destroy();
});

const input = {val: 1};
console.log('Adding job', input);
client.addJob(input);

```