* Registers an event listener for the given event. * @param event Event name * @param callback Callback to be executed when the event is emitted
(event: string | number | symbol, callback: Function)
| 328 | * @param callback Callback to be executed when the event is emitted |
| 329 | */ |
| 330 | public on(event: string | number | symbol, callback: Function) { |
| 331 | if ('on' in this.serverInstance) { |
| 332 | return this.serverInstance.on(event as string, callback); |
| 333 | } |
| 334 | throw new Error('"on" method not supported by the underlying server'); |
| 335 | } |
| 336 | |
| 337 | /** |
| 338 | * Returns an instance of the underlying server/broker instance, |