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

Method handleMessage

packages/microservices/client/client-rmq.ts:344–372  ·  view source on GitHub ↗
(
    packet: unknown,
    options:
      | Record<string, unknown>
      | ((packet: WritePacket) => any)
      | undefined,
    callback?: (packet: WritePacket) => any,
  )

Source from the content-addressed store, hash-verified

342 callback: (packet: WritePacket) => any,
343 ): Promise<void>;
344 public async handleMessage(
345 packet: unknown,
346 options:
347 | Record<string, unknown>
348 | ((packet: WritePacket) => any)
349 | undefined,
350 callback?: (packet: WritePacket) => any,
351 ): Promise<void> {
352 if (isFunction(options)) {
353 callback = options as (packet: WritePacket) => any;
354 options = undefined;
355 }
356
357 const { err, response, isDisposed } = await this.deserializer.deserialize(
358 packet,
359 options,
360 );
361 if (isDisposed || err) {
362 return callback?.({
363 err,
364 response,
365 isDisposed: true,
366 });
367 }
368 callback?.({
369 err,
370 response,
371 });
372 }
373
374 protected publish(
375 message: ReadPacket,

Callers 8

listenerMethod · 0.95
client-rmq.spec.tsFile · 0.45
server-rmq.spec.tsFile · 0.45
server-tcp.spec.tsFile · 0.45

Calls 3

isFunctionFunction · 0.90
deserializeMethod · 0.65
callbackFunction · 0.50

Tested by

no test coverage detected