Skip to content
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

Merged
merged 10 commits into from
Sep 4, 2024
Merged

Recipe: Caches #241

merged 10 commits into from
Sep 4, 2024

Conversation

Lotes
Copy link
Contributor

@Lotes Lotes commented Jun 20, 2024

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?

@Lotes Lotes temporarily deployed to pull-request-preview June 20, 2024 09:30 — with GitHub Actions Inactive
Copy link

github-actions bot commented Jun 20, 2024

PR Preview Action v1.4.6
Preview removed because the pull request was closed.
2024-09-04 15:31 UTC

@Lotes Lotes temporarily deployed to pull-request-preview June 20, 2024 10:05 — with GitHub Actions Inactive
Copy link
Contributor

@montymxb montymxb left a 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.

hugo/content/docs/recipes/utilities/caches.md Outdated Show resolved Hide resolved
hugo/content/docs/recipes/utilities/caches.md Outdated Show resolved Hide resolved
hugo/content/docs/recipes/utilities/caches.md Outdated Show resolved Hide resolved
hugo/content/docs/recipes/utilities/caches.md Outdated Show resolved Hide resolved
hugo/content/docs/recipes/utilities/caches.md Outdated Show resolved Hide resolved
hugo/content/docs/recipes/utilities/caches.md Outdated Show resolved Hide resolved
@Lotes
Copy link
Contributor Author

Lotes commented Jun 29, 2024

@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.

@Lotes Lotes temporarily deployed to pull-request-preview August 7, 2024 06:59 — with GitHub Actions Inactive
@Lotes Lotes temporarily deployed to pull-request-preview August 7, 2024 07:06 — with GitHub Actions Inactive
@Lotes Lotes temporarily deployed to pull-request-preview August 7, 2024 07:08 — with GitHub Actions Inactive
@msujew
Copy link
Member

msujew commented Aug 7, 2024

@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.

hugo/content/docs/recipes/performance/caches.md Outdated Show resolved Hide resolved
hugo/content/docs/recipes/performance/caches.md Outdated Show resolved Hide resolved
hugo/content/docs/recipes/performance/caches.md Outdated Show resolved Hide resolved
hugo/content/docs/recipes/performance/caches.md Outdated Show resolved Hide resolved
hugo/content/docs/recipes/performance/caches.md Outdated Show resolved Hide resolved
hugo/content/docs/recipes/performance/caches.md Outdated Show resolved Hide resolved
hugo/content/docs/recipes/performance/caches.md Outdated Show resolved Hide resolved
@Lotes
Copy link
Contributor Author

Lotes commented Aug 28, 2024

Thanks, I added your suggestions, @msujew .

Copy link
Member

@msujew msujew left a 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 👍

@msujew msujew merged commit 7f098d8 into main Sep 4, 2024
5 checks passed
@msujew msujew deleted the lotes/document-cache branch September 4, 2024 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants