Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 595 Bytes

README.md

File metadata and controls

36 lines (27 loc) · 595 Bytes

resultqueue

Result queue on top of bull

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);