queue-events-producer.d.ts 827 B

123456789101112131415161718192021
  1. import { QueueEventsProducerOptions } from '../interfaces';
  2. import { QueueBase } from './queue-base';
  3. import { RedisConnection } from './redis-connection';
  4. /**
  5. * The QueueEventsProducer class is used for publishing custom events.
  6. */
  7. export declare class QueueEventsProducer extends QueueBase {
  8. constructor(name: string, opts?: QueueEventsProducerOptions, Connection?: typeof RedisConnection);
  9. /**
  10. * Publish custom event to be processed in QueueEvents.
  11. * @param argsObj - Event payload
  12. * @param maxEvents - Max quantity of events to be saved
  13. */
  14. publishEvent<T extends {
  15. eventName: string;
  16. }>(argsObj: T, maxEvents?: number): Promise<void>;
  17. /**
  18. * Closes the connection and returns a promise that resolves when the connection is closed.
  19. */
  20. close(): Promise<void>;
  21. }