MCPcopy
hub / github.com/nestjs/nest / on

Method on

packages/microservices/nest-microservice.ts:330–335  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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,

Callers

nothing calls this directly

Calls 1

onMethod · 0.65

Tested by

no test coverage detected