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

Revise Cacher interface: include Release method? #286

Open
matthiasgeihs opened this issue Dec 8, 2021 · 0 comments
Open

Revise Cacher interface: include Release method? #286

matthiasgeihs opened this issue Dec 8, 2021 · 0 comments

Comments

@matthiasgeihs
Copy link
Contributor

Yes I meant the Cacher interface. I thought we should include Release method in the Cacher interface because it complements the Cache method, by disabling caching of a particular item. Looking further, I noticed

  1. Cacher interface is referenced in the client package. Here, we use only the Cache method and not the Release method.
  2. Cache is the only implementation of Cacher interface. The Release method on it is an implementation detail, that is referenced only inside the wire package.

So, my suggestion would be that, in a separate PR:

  1. We can make Cache, its methods and the MakeCache function unexported.
  2. We can retain the Cacher interface, because it allows us to freely refactor the Cache implementation (like removing use of context and adding Release method, which you did in this PR).

Originally posted by @manoranjith in #276 (comment)

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

No branches or pull requests

1 participant