-
Notifications
You must be signed in to change notification settings - Fork 210
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(provider): LRUCache Layer #954
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some questions
Decided to make this a provider-layer, this lets us achieve two very important features that wouldn't work as a transport layer:
To accomplish this we need to merge #788 |
crates/provider/src/layers/cache.rs
Outdated
let cache = CacheLayer::new(100); | ||
let anvil = Anvil::new().block_time_f64(0.3).spawn(); | ||
let provider = ProviderBuilder::default() | ||
// .with_recommended_fillers() - TODO: Issue here. Layer doesn't work with fillers. Fix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enabling fillers would wrap the CacheProvider
or any other layer provider in a FillProvider
. Making methods on CacheProvider
inaccessible. i.e provider.load_cache(path)
won't work but provider.inner.load_cache(path)
works.
This is not ideal.
Motivation
Ref: #770
Solution
WIP
key
is the hash of the serialized request params.TODO
save_cache
andload_cache
via provider.PR Checklist