@cashfarm/plow
Version:
Library for validating input data and parameters
27 lines • 767 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const servicebus = require('servicebus');
const debug = require('debug')('plow:events');
class RabbitMQTransport {
constructor() {
const bus = servicebus.bus();
bus.use(bus.package());
bus.use(bus.correlate());
bus.use(bus.logger());
this.bus = bus;
}
listen(topic, handler) {
this.bus.listen(topic, handler);
}
send(topic, message) {
this.bus.send(topic, message);
}
subscribe(topic, handler) {
this.bus.subscribe(topic, handler);
}
publish(topic, message) {
this.bus.publish(topic, message);
}
}
exports.RabbitMQTransport = RabbitMQTransport;
//# sourceMappingURL=index.js.map