(topic: string, { action, message }: { action: string; message: any })
| 55 | } |
| 56 | |
| 57 | handler(topic: string, { action, message }: { action: string; message: any }) { |
| 58 | LoggerCore.getInstance() |
| 59 | .logger({ service: "messageQueue" }) |
| 60 | .trace("messageQueueHandler", { action, topic, message }); |
| 61 | switch (action) { |
| 62 | case "message": |
| 63 | this.EE.emit(topic, message); |
| 64 | break; |
| 65 | default: |
| 66 | throw new Error("action not found"); |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | subscribe<T>(topic: string, handler: (msg: T) => void) { |
| 71 | this.EE.on(topic, handler); |
no test coverage detected