redis-smq
Version:
A high-performance, reliable, and scalable message queue for Node.js.
24 lines • 713 B
JavaScript
import { FactoryAbstract } from './factory-abstract.js';
import { Producer } from '../../producer/index.js';
export class ProducerFactory extends FactoryAbstract {
static create = () => {
this.ensureInitialized();
return this.track(new Producer());
};
static startProducer(cb) {
const producer = ProducerFactory.create();
if (cb) {
producer.run((err) => {
if (err)
return cb(err);
cb(null);
});
return producer;
}
return (async () => {
await producer.run();
return producer;
})();
}
}
//# sourceMappingURL=producer-factory.js.map