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
- Host: GitHub
- URL: https://github.com/optimalbits/resultqueue
- Owner: OptimalBits
- Created: 2018-02-16T10:12:15.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-20T14:59:00.000Z (over 8 years ago)
- Last Synced: 2025-03-25T16:55:30.538Z (about 1 year ago)
- Language: JavaScript
- Size: 41 KB
- Stars: 3
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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);
```