UNPKG

rabbitmq-event-manager

Version:

A nodeJS Event Manager to emit, and listen event through RabbitMQ

14 lines (13 loc) 716 B
import { EventHandlerFunction, IEmitAndWaitOptions, IEventManagerOptions, IEventPayload, IListenerOption } from './lib/interfaces'; export declare class EventManager { private options; constructor(options?: Partial<IEventManagerOptions>); private createLogger; on(eventName: string, listener: EventHandlerFunction, options?: IListenerOption): Promise<void>; emit(eventName: string, payload: IEventPayload): Promise<IEventPayload>; emitAndWait(eventName: string, payload: IEventPayload, replyToName?: string, options?: IEmitAndWaitOptions): Promise<IEventPayload>; initialize(): Promise<void>; close(): Promise<void>; private addMetasToPayload; private emitResponseIfNeeded; }