go-perun
go-perun copied to clipboard
Revise `Cacher` interface: include `Release` method?
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
-
Cacher
interface is referenced in the client package. Here, we use only theCache
method and not theRelease
method. -
Cache
is the only implementation ofCacher
interface. TheRelease
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:
- We can make
Cache
, its methods and theMakeCache
function unexported. - We can retain the
Cacher
interface, because it allows us to freely refactor theCache
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