arvo-event-handler
Version:
Type-safe event handler system with versioning, telemetry, and contract validation for distributed Arvo event-driven architectures, featuring routing and multi-handler support.
44 lines (43 loc) • 2.11 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.TransactionViolation = exports.TransactionViolationCause = void 0;
var arvo_core_1 = require("arvo-core");
var TransactionViolationCause;
(function (TransactionViolationCause) {
TransactionViolationCause["READ_FAILURE"] = "READ_MACHINE_MEMORY_FAILURE";
TransactionViolationCause["LOCK_FAILURE"] = "LOCK_MACHINE_MEMORY_FAILURE";
TransactionViolationCause["WRITE_FAILURE"] = "WRITE_MACHINE_MEMORY_FAILURE";
TransactionViolationCause["LOCK_UNACQUIRED"] = "LOCK_UNACQUIRED";
TransactionViolationCause["INVALID_SUBJECT"] = "INVALID_SUBJECT";
})(TransactionViolationCause || (exports.TransactionViolationCause = TransactionViolationCause = {}));
var TransactionViolation = /** @class */ (function (_super) {
__extends(TransactionViolation, _super);
function TransactionViolation(param) {
var _this = _super.call(this, {
type: 'OrchestratorTransaction',
message: "[".concat(param.cause, "] ").concat(param.message),
metadata: {
initiatingEvent: param.initiatingEvent,
},
}) || this;
_this.cause = param.cause;
return _this;
}
return TransactionViolation;
}(arvo_core_1.ViolationError));
exports.TransactionViolation = TransactionViolation;