nest-cluster-ipc
Version:
A Nest module wrapper for node-cluster-ipc
18 lines • 857 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.OnRequest = exports.OnMessage = exports.InjectClusterIpc = void 0;
const common_1 = require("@nestjs/common");
const cluster_ipc_constants_1 = require("../cluster-ipc.constants");
const InjectClusterIpc = () => {
return (0, common_1.Inject)(cluster_ipc_constants_1.CLUSTER_IPC_INSTANCE);
};
exports.InjectClusterIpc = InjectClusterIpc;
const OnMessage = (channel) => {
return (0, common_1.SetMetadata)(cluster_ipc_constants_1.CLUSTER_IPC_LISTENER_METADATA, { event: 'message', channel });
};
exports.OnMessage = OnMessage;
const OnRequest = (channel) => {
return (0, common_1.SetMetadata)(cluster_ipc_constants_1.CLUSTER_IPC_LISTENER_METADATA, { event: 'request', channel });
};
exports.OnRequest = OnRequest;
//# sourceMappingURL=cluster-ipc.decorators.js.map