UNPKG

vulcain-corejs

Version:
30 lines (28 loc) 817 B
"use strict"; class LocalAdapter { startAsync() { return Promise.resolve(this); } sendEvent(domain, event) { // console.log("Event: %j", event); let self = this; self.eventHandler && setTimeout(function () { self.eventHandler(event); }, (1)); } listenForEvent(domain, handler) { this.eventHandler = handler; } publishTask(domain, serviceId, command) { let self = this; self.commandHandler && setTimeout(function () { // console.log("Running task: %j", command); self.commandHandler(command); }, (1)); } listenForTask(domain, serviceId, handler) { this.commandHandler = handler; } } exports.LocalAdapter = LocalAdapter; //# sourceMappingURL=localAdapter.js.map