@nestjstools/messaging
Version:
Simplifies asynchronous and synchronous message handling with support for buses, handlers, channels, and consumers. Build scalable, decoupled applications with ease and reliability.
28 lines • 1.7 kB
JavaScript
;
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.InMemoryChannelFactory = void 0;
const common_1 = require("@nestjs/common");
const decorator_1 = require("../../dependency-injection/decorator");
const config_1 = require("../../config");
const in_memory_channel_1 = require("../in-memory.channel");
const invalid_channel_config_exception_1 = require("../../exception/invalid-channel-config.exception");
let InMemoryChannelFactory = class InMemoryChannelFactory {
create(channelConfig) {
if (!(channelConfig instanceof config_1.InMemoryChannelConfig)) {
throw new invalid_channel_config_exception_1.InvalidChannelConfigException(config_1.InMemoryChannelConfig.name);
}
return new in_memory_channel_1.InMemoryChannel(channelConfig);
}
};
exports.InMemoryChannelFactory = InMemoryChannelFactory;
exports.InMemoryChannelFactory = InMemoryChannelFactory = __decorate([
(0, common_1.Injectable)(),
(0, decorator_1.ChannelFactory)(config_1.InMemoryChannelConfig)
], InMemoryChannelFactory);
//# sourceMappingURL=in-memory-channel.factory.js.map