-
Notifications
You must be signed in to change notification settings - Fork 323
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
Enhance Managed_Resource
to allow implementation of in-memory caches
#11577
Conversation
engine/runtime/src/main/java/org/enso/interpreter/runtime/ReferencesManager.java
Outdated
Show resolved
Hide resolved
How do we create a "static" instance of one of these? Guess we just put one into Java as usual. |
Ref.new allow_gc=True
to implement in-memory caches
engine/runtime/src/main/java/org/enso/interpreter/runtime/data/Ref.java
Outdated
Show resolved
Hide resolved
engine/runtime/src/main/java/org/enso/interpreter/runtime/data/Ref.java
Outdated
Show resolved
Hide resolved
engine/runtime-integration-tests/src/test/java/org/enso/interpreter/runtime/RefTest.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting idea. LGTM. I am a bit afraid about transient failures in the RefTest
.
engine/runtime-integration-tests/src/test/java/org/enso/interpreter/runtime/RefTest.java
Show resolved
Hide resolved
@JaroslavTulach I'll get this connected to my cache and write a test for it. |
std-bits/base/src/main/java/org/enso/base/enso_cloud/EnsoSecretHelper.java
Outdated
Show resolved
Hide resolved
Ref.new allow_gc=True
to implement in-memory cachesManaged_Resource
to allow implementation of in-memory caches
std-bits/base/src/main/java/org/enso/base/enso_cloud/EnsoSecretHelper.java
Show resolved
Hide resolved
distribution/lib/Standard/Base/0.0.0-dev/src/Runtime/Managed_Resource.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Base/0.0.0-dev/src/Runtime/Managed_Resource.enso
Outdated
Show resolved
Hide resolved
engine/runtime/src/main/java/org/enso/interpreter/runtime/ResourceManager.java
Outdated
Show resolved
Hide resolved
engine/runtime/src/main/java/org/enso/interpreter/runtime/data/ManagedResource.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good but I'd change the default on_missing
to something more 'visible' than Nothing
. We are having plenty of issues caused by accidentally discarding errors, so it's better if we program more 'defensively' against this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I have created #11714 to potentially remove now even more deprecated AutomaticParallelism IR pass and Name.Special IR elements.
distribution/lib/Standard/Base/0.0.0-dev/src/Runtime/Managed_Resource.enso
Outdated
Show resolved
Hide resolved
...ne/runtime/src/main/java/org/enso/interpreter/node/expression/builtin/resource/WithNode.java
Outdated
Show resolved
Hide resolved
engine/runtime/src/main/scala/org/enso/interpreter/runtime/IrToTruffle.scala
Show resolved
Hide resolved
...untime-integration-tests/src/test/java/org/enso/interpreter/runtime/ManagedResourceTest.java
Show resolved
Hide resolved
Co-authored-by: Radosław Waśko <[email protected]>
05c3812
to
a1f7e6f
Compare
Pull Request Description
Allows connection between refresh button and caches as requested by #11485:
Managed_Resource.new system_resource=True
to create a reference that "can disappear"EnsoContext.getResourceManager().scheduleFinalization()
to clear the caches when the refresh button is pressedResourceManager
providesscheduleFinalization
method that allows cleanup of "system managed" referencesChecklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,