-
-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Blockly] Modify the Value Storage blocks to use the new sharedCache and privateCache #1577
Comments
If this is implemented (and throughly tested) during the feature freeze I'll consider it as a "fix" :) |
@rkoshak I decided to use the private cache for the ValueCache in JS Scripting Blockly, but after Stefan and I are finished with the portation of Blockly and this is merged, we can of course tweak Blockly to also allow access to the shared cache. We only have to make sure that we do not break existing Blockly scripts. |
I figured this would probably best fit in with that work. There was no way I was going to be able to get to this before the 3.4 release and I agree, now it doesn't make a whole lot of sense to back port it to Nashorn. |
I have added a link to this as a reminder to the „big“ issue for the Blockly porting. |
How do you like that, @rkoshak ? These blocks will only appear when you have jsscripting installed. Otherwise they stay as they are without the choice to select the cache. |
This will be fixed with #1597 and is already implemented there. You might want to close it here. |
Fixed by #1597 |
Which UI are you reporting an issue for?
Blockly
The problem
The current implementation relies on the fact that a script is reused after it's first created. Objects and variables cannot be shared between scripts and data is not cleaned up when scripts are unloaded.
Your suggestion
With the introduction of sharedCache and privateCache there is now a way integrated into core to preserve variables between runs of a rule (privateCache) and to share Objects and values between rules (sharedCache). These have the advantage that they get cleaned up when the rules are unloaded (no more stale timers going off when a rule is reloaded) and we have cross script sharing. It should even work across scripts written in different languages.
If just the
privateCache
is implemented (limited to that one script), the existing blocks could probably be reused with only changes to the back end JavaScript being required. IfsharedCache
is added, a new set of similar blocks will be needed, or an option added to the existing blocks to choose which cache is being used.Your environment
Additional information
The text was updated successfully, but these errors were encountered: