add a worker module

This commit is contained in:
2016-04-18 16:39:35 -07:00
parent 4416a5508d
commit 1b5f2af004
3 changed files with 23 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
import events from 'events';
import createClient from './helpers/create_client';
import Job from './job.js';
import Worker from './worker.js';
import { omit } from 'lodash';
export default class Elastique extends events.EventEmitter {
@@ -24,4 +25,9 @@ export default class Elastique extends events.EventEmitter {
const job = new Job(this, type, payload, options);
return job;
}
registerWorker(type, workerFn) {
const worker = new Worker(this, type, workerFn);
return worker;
}
}