Create a new script instance for each script layer #2182
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As far as I know, currently the user script files are compiled and instanced once during the startup. This forces you to use the same shared state between multiple script layers.
In this pull request, I propose to let each layer have its own instance of the script.
This way, I can have each script layer have its own connection to a web service, where they can get different values based on what I define in the script layer parameters.
This pull request proposes the following changes:
Known issues/To do:
I implemented this in the smallest way change-wise. The code could be more broadly redone to accomodate this change.
Also, the whole idea in the first place is up for discussion: Is this change even desirable? Or is there already another way to achieve this?
Please comment and feel free to edit. Thank you!