@nestjs/microservices
Version:
Microservices for NestJS: message and event handlers over Kafka, RabbitMQ, NATS, Redis, MQTT, gRPC or TCP.
17 lines (16 loc) • 536 B
JavaScript
import { CLIENT_CONFIGURATION_METADATA, CLIENT_METADATA, } from '../constants.js';
/**
* Attaches the `ClientProxy` instance to the given property
*
* @param {ClientOptions} metadata optional client metadata
*
* @publicApi
*
*/
export function Client(metadata) {
return (target, propertyKey) => {
Reflect.set(target, propertyKey, null);
Reflect.defineMetadata(CLIENT_METADATA, true, target, propertyKey);
Reflect.defineMetadata(CLIENT_CONFIGURATION_METADATA, metadata, target, propertyKey);
};
}