Replies: 1 comment 1 reply
-
For me your description is still a bit abstract (I didn't dig into example code). But some thoughts:
Sharing an engine is generally a bad idea in my opinion, so it should be avoided. I didn't quite grasp why you would need to share one. Just because you think it might be slow or has the engine instance actual state state has to be shared between multiple consumers? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone,
I'm currently building an extensible application using Jint. The main purpose for the app is to create (dashboard)-images for thin-client displays (ESP32). A current (working) draft is available here.
Therefore I write JavaScript files to define the content of the image and doing the heavy creation logic in C#. Im offering states of an external system (Home Assistant) to JavaScript to react to different conditions etc.
I've decided that scripts should work the following way:
This approach allows me to keep the modules loaded in-memory and reduce the overhead of holding all external states, but it comes with a few down sides:
Another problem which comes in my mind is, that I want to add cron jobs to fetch (web)-data or interacting with other systems. This is another source of locking the engine somewhere else.
Do you have better solutions or other ideas for this problem, while keeping the ability to change scripts at runtime?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions