2
0
mirror of https://github.com/esiur/esiur-js.git synced 2026-04-04 05:58:22 +00:00

Static Calling

This commit is contained in:
2022-08-07 23:08:33 +03:00
parent 551f0f4684
commit bf861395c3
10 changed files with 429 additions and 77 deletions

View File

@@ -231,7 +231,18 @@ export default class DistributedResource extends IResource
if (index >= this.instance.template.functions.length)
throw new Error("Function index is incorrect");
return this._p.connection.sendInvoke(this._p.instanceId, index, args);
let ft = this.instance.template.getFunctionTemplateByIndex(index);
if (ft == null)
throw new Exception("Function template not found.");
if (ft.isStatic)
return this._p.connection.staticCall(this.instance.template.classId, index, args);
else
return this._p.connection.sendInvoke(this._p.instanceId, index, args);
//return this._p.connection.sendInvoke(this._p.instanceId, index, args);
}
_get(index)