@nestjs/microservices
Version:
Microservices for NestJS: message and event handlers over Kafka, RabbitMQ, NATS, Redis, MQTT, gRPC or TCP.
28 lines (27 loc) • 547 B
JavaScript
import { BaseRpcContext } from './base-rpc.context.js';
/**
* @publicApi
*/
export class TcpContext extends BaseRpcContext {
constructor(args) {
super(args);
}
/**
* Returns the underlying JSON socket.
*/
getSocketRef() {
return this.args[0];
}
/**
* Returns the name of the pattern.
*/
getPattern() {
return this.args[1];
}
/**
* Returns the metadata the client attached to the packet, if any.
*/
getMetadata() {
return this.args[2];
}
}