@rkmodules/rules 0.0.172 → 0.0.173
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +27 -14
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.mjs +27 -14
- package/dist/index.esm.mjs.map +1 -1
- package/dist/lib/Engine/cache.d.ts +2 -0
- package/package.json +1 -1
- package/readme.md +4 -1
package/dist/index.esm.mjs
CHANGED
|
@@ -3578,10 +3578,11 @@ var Engine = /** @class */ (function () {
|
|
|
3578
3578
|
};
|
|
3579
3579
|
Engine.prototype.executeCall = function (fn_1, call_1, inputs_1, params_1, context_1, name_1, executionId_1, run_1, path_1) {
|
|
3580
3580
|
return __awaiter(this, arguments, void 0, function (fn, call, inputs, params, context, name, executionId, run, path, root) {
|
|
3581
|
-
var graphRunner, kind, hit, startTime, start, result, createdAt,
|
|
3581
|
+
var graphRunner, kind, hit, startTime, start, result, createdAt, started_1, activate, impl, endTime, event;
|
|
3582
|
+
var _this = this;
|
|
3582
3583
|
if (root === void 0) { root = false; }
|
|
3583
|
-
return __generator(this, function (
|
|
3584
|
-
switch (
|
|
3584
|
+
return __generator(this, function (_a) {
|
|
3585
|
+
switch (_a.label) {
|
|
3585
3586
|
case 0:
|
|
3586
3587
|
this.cache.visit(run, path);
|
|
3587
3588
|
graphRunner = this.graphRunners.get(fn);
|
|
@@ -3610,24 +3611,36 @@ var Engine = /** @class */ (function () {
|
|
|
3610
3611
|
createdAt = hit.info.createdAt;
|
|
3611
3612
|
return [3 /*break*/, 8];
|
|
3612
3613
|
case 1:
|
|
3613
|
-
context.activations[name] =
|
|
3614
|
+
context.activations[name] = false;
|
|
3615
|
+
started_1 = false;
|
|
3616
|
+
activate = function () {
|
|
3617
|
+
var _a;
|
|
3618
|
+
if (started_1)
|
|
3619
|
+
return;
|
|
3620
|
+
started_1 = true;
|
|
3621
|
+
(_a = run.onPrimitiveExecution) === null || _a === void 0 ? void 0 : _a.call(run);
|
|
3622
|
+
context.activations[name] = true;
|
|
3623
|
+
_this.fireEvent("functionCall", start);
|
|
3624
|
+
};
|
|
3614
3625
|
impl = fn.impl;
|
|
3615
|
-
|
|
3616
|
-
_b.label = 2;
|
|
3626
|
+
_a.label = 2;
|
|
3617
3627
|
case 2:
|
|
3618
|
-
|
|
3619
|
-
this.fireEvent("functionCall", start);
|
|
3628
|
+
_a.trys.push([2, , 7, 8]);
|
|
3620
3629
|
if (!graphRunner) return [3 /*break*/, 4];
|
|
3621
|
-
return [4 /*yield*/, graphRunner(inputs, params, run, path)];
|
|
3630
|
+
return [4 /*yield*/, graphRunner(inputs, params, __assign(__assign({}, run), { onPrimitiveExecution: activate }), path)];
|
|
3622
3631
|
case 3:
|
|
3623
|
-
|
|
3632
|
+
// Traversal alone is not activity. Defer this graph's call
|
|
3633
|
+
// event until the first cache miss, including in nested graphs.
|
|
3634
|
+
result = (_a.sent()).result;
|
|
3624
3635
|
return [3 /*break*/, 6];
|
|
3625
|
-
case 4:
|
|
3636
|
+
case 4:
|
|
3637
|
+
activate();
|
|
3638
|
+
console.log("Executing function call: ".concat(name));
|
|
3639
|
+
return [4 /*yield*/, impl.call(fn, inputs, params, this, root ? null : context, name)];
|
|
3626
3640
|
case 5:
|
|
3627
|
-
|
|
3628
|
-
|
|
3641
|
+
result = _a.sent();
|
|
3642
|
+
_a.label = 6;
|
|
3629
3643
|
case 6:
|
|
3630
|
-
result = _a;
|
|
3631
3644
|
createdAt = Date.now();
|
|
3632
3645
|
if (kind)
|
|
3633
3646
|
this.cache.set(run, path, kind, fn, call, inputs, params, result, impl, createdAt);
|