Thanks for the great library. I've been using cached today to cache authentication tokens which know their own expiry and have a solution that may or may not be best here as a separate cache in src/stores/expired_value_cache.rs or similar.
Let me know if this is something that you'd like in the repo here and I'll create a PR and update it so the code follows the patterns/structure that I see in the timed.rs implementation. Or if I've missed something and this functionality is already available with what's there, let me know :)
Thanks for the great library. I've been using cached today to cache authentication tokens which know their own expiry and have a solution that may or may not be best here as a separate cache in
src/stores/expired_value_cache.rs
or similar.It works by defining a
CanExpire
trait:then implements your
Cached
trait with theCanExpire
restriction on the value:You can see the full details in the PR at https://github.com/vmware-tanzu/kubeapps/pull/4899/files
Let me know if this is something that you'd like in the repo here and I'll create a PR and update it so the code follows the patterns/structure that I see in the
timed.rs
implementation. Or if I've missed something and this functionality is already available with what's there, let me know :)Thanks!