Skip to content

how to call a js function in another js engine safely #1560

Answered by Genteure
Zaitonn asked this question in Q&A
Discussion options

You must be logged in to vote

Would you benefit from having multiple instances of Engine? If single thread performance is acceptable, having only one Engine would greatly reduce the complexity.

If multiple instances are necessary, I would recommend writing the "bridge" between Engines purely with C# primitive types and strings. Every "Jint object" holds a reference to their "owning" Engine, and creates other objects from that Engine. I could be wrong but I don't think mixing multiple Engines together is a good idea or even a supported use case, you would have a bird nest mesh of objects coming from different Engines mixed together.

Checkout Worker API for inspirations on implementing APIs that passes data between scri…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
3 replies
@Genteure
Comment options

@Zaitonn
Comment options

@Zaitonn
Comment options

Comment options

You must be logged in to vote
3 replies
@Zaitonn
Comment options

@Genteure
Comment options

@Zaitonn
Comment options

Answer selected by Zaitonn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants