(event: T)
| 82 | } |
| 83 | |
| 84 | publish(event: T): void { |
| 85 | if (this.disposed) return |
| 86 | this.pub.publish(this.config.channel, JSON.stringify(event)).catch((err) => { |
| 87 | logger.error(`Failed to publish to ${this.config.label}:`, err) |
| 88 | }) |
| 89 | } |
| 90 | |
| 91 | subscribe(handler: (event: T) => void): () => void { |
| 92 | this.handlers.add(handler) |