-
now I need to call a function in another js engine in order to create more features for my application here is my way but maybe there are some errors i think :( flowchart TD
e1("engine1(JS1)")
e2("engine2(JS2)")
e3("engine3(JS3)")
e1-- export functions -->e2
e1-- export functions -->e3
c1["lock engine1 to call functions which are exported from it in c#"]
e2 --> c1
e3 --> c1
c2["return values to engine2/3"]
c1--->c2
i expect that the two engine(2/3) should correctly call the function I have tried single-step debugging in C#, and it turned out that the code is stuck at line are there any mistakes? :(( i have been puzzled at it for days if i remove jint: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
20230606102749.mp4 |
Beta Was this translation helpful? Give feedback.
-
Would you benefit from having multiple instances of If multiple instances are necessary, I would recommend writing the "bridge" between Checkout Worker API for inspirations on implementing APIs that passes data between scripting contexts, specifically P.S. The video does play in VLC, but I still can't figure out what's happening. |
Beta Was this translation helpful? Give feedback.
Would you benefit from having multiple instances of
Engine
? If single thread performance is acceptable, having only oneEngine
would greatly reduce the complexity.If multiple instances are necessary, I would recommend writing the "bridge" between
Engine
s purely with C# primitive types and strings. Every "Jint object" holds a reference to their "owning"Engine
, and creates other objects from thatEngine
. I could be wrong but I don't think mixing multipleEngine
s together is a good idea or even a supported use case, you would have a bird nest mesh of objects coming from differentEngine
s mixed together.Checkout Worker API for inspirations on implementing APIs that passes data between scri…