2.0.1 • Published 5 years ago

@fofx/queue v2.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

queue

Pure node implementation of a distributed queue

Usage

// broker.js
const { startQueueBroker } = require('@fofx/queue').distributed;
const { add } = startQueueBroker(9000);
add({ x: 1, y: 2 }).then(value => console.log(value));
// worker.js
const { startQueueWorker } = require('@fofx/queue').distributed;
const worker = startQueueWorker('ws://localhost:9000');
worker.register(async function add({ x, y }) {
  const constant = await worker.get('const', 0);
  const value = x + y + constant;
  await worker.set('const', value);
  return x + y;
});
2.0.1

5 years ago

2.0.0

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago