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

feat: add result cache consumer #341

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Willem-J-an
Copy link

@Willem-J-an Willem-J-an commented Jan 3, 2024

Attempt to solve #195.

Need some feedback: the client interface does not seem to expose any way to update results. Any pointers on how to solve this? I have some ideas but not super happy with them:

  1. The client exposes a method to update_results; might expose too much internals to consumers
  2. The client exposes a method to load results from cache (as done now); bit weird because it's logic only my consumer needs, but arguably exposes less internals.

@Willem-J-an Willem-J-an marked this pull request as ready for review January 5, 2024 12:59
@Willem-J-an
Copy link
Author

@rcarriga any feedback on this? Thanks!

Copy link
Collaborator

@rcarriga rcarriga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Overall love the idea, just some minor fixes/changes. I also think this would make sense as part of the state consumer and in the state consumer config we can have something like persist_results: boolean, rather than a whole separate consumer for it. It can still be a separate module to keep it tidy

lua/neotest/client/init.lua Outdated Show resolved Hide resolved
lua/neotest/consumers/result_cache.lua Outdated Show resolved Hide resolved
lua/neotest/consumers/result_cache.lua Outdated Show resolved Hide resolved
lua/neotest/consumers/result_cache.lua Outdated Show resolved Hide resolved
lua/neotest/consumers/result_cache.lua Show resolved Hide resolved
lua/neotest/consumers/result_cache.lua Show resolved Hide resolved
@Willem-J-an
Copy link
Author

Thanks for the PR! Overall love the idea, just some minor fixes/changes. I also think this would make sense as part of the state consumer and in the state consumer config we can have something like persist_results: boolean, rather than a whole separate consumer for it. It can still be a separate module to keep it tidy

I have added a config to auto load cache on startup; not sure now what functionality you would expect from a persist_results boolean. It should automatically cache all results as soon as they come in; rather than having to execute a command to cache it?

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.

2 participants