UNPKG

redis-smq

Version:

A high-performance, reliable, and scalable message queue for Node.js.

24 lines 768 B
import { EventBusRedis } from 'redis-smq-common'; import { RedisConfig } from '../common/redis/redis-config.js'; export class InternalEventBus { static instance = null; constructor() { } static getInstance() { if (!InternalEventBus.instance) { const cfg = { redis: RedisConfig.getConfig(), }; InternalEventBus.instance = new EventBusRedis(cfg, 'system'); } return InternalEventBus.instance; } static shutdown(cb) { if (InternalEventBus.instance) return InternalEventBus.instance.shutdown(() => { InternalEventBus.instance = null; cb(); }); cb(); } } //# sourceMappingURL=internal-event-bus.js.map