go-perun icon indicating copy to clipboard operation
go-perun copied to clipboard

Revise `Cacher` interface: include `Release` method?

Open matthiasgeihs opened this issue 3 years ago • 0 comments

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 https://github.com/hyperledger-labs/go-perun/pull/276#discussion_r764590896

matthiasgeihs avatar Dec 08 '21 08:12 matthiasgeihs