-
Notifications
You must be signed in to change notification settings - Fork 35
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
Recipe: Caches #241
Recipe: Caches #241
Conversation
|
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.
Cool 🙂 . Just added some grammar suggestions, but the content looks really nice.
@msujew Can you tell me whether there is a common way in Langium to register the disposal of a cache? I explained the method, but have not shown any connection points with Langium. |
Co-authored-by: Benjamin Friedman Wilson <[email protected]>
Co-authored-by: Benjamin Friedman Wilson <[email protected]>
Co-authored-by: Benjamin Friedman Wilson <[email protected]>
Co-authored-by: Benjamin Friedman Wilson <[email protected]>
Co-authored-by: Benjamin Friedman Wilson <[email protected]>
Co-authored-by: Benjamin Friedman Wilson <[email protected]>
@Lotes Given that the language server process lives and dies with its connection (and therefore also service container), any global caches (i.e. caches that live as part of a service implementation) are "disposed" as soon as the language server or its owning service container dies. They don't need to be explicitly registered for disposal. Making these caches disposable was designed for cases in which the cache itself is designed to be short-lived. I assume these cases are fairly rare (we have none in our framework) and there's no recommended way of performing the disposal for now. |
Thanks, I added your suggestions, @msujew . |
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 to me, thanks 👍
I added a recipe about the document cache.
I am also mentioning the other caches (WorkspaceCache, ContextCache and SimpleCache).
I moved this recipe under the category "utilities". Maybe "performance" would be better?