egirlskey/src/queue/processors/http/index.ts
2018-04-09 17:38:22 +09:00

18 lines
315 B
TypeScript

import deliver from './deliver';
import processInbox from './process-inbox';
const handlers = {
deliver,
processInbox,
};
export default (job, done) => {
const handler = handlers[job.data.type];
if (handler) {
handler(job, done);
} else {
console.error(`Unknown job: ${job.data.type}`);
done();
}
};