-
Notifications
You must be signed in to change notification settings - Fork 20
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
How to combine with https://github.com/inyutin/aiohttp_retry #16
Comments
Good question! Yes, there would be a few different ways to combine these. This library subclasses import aiohttp_retry
import aiohttp_client_cache
aiohttp_retry.ClientSession = aiohttp_client_cache.CachedSession
client = aiohttp_retry.RetryClient(...) Or replace it after initialization: client = aiohttp_retry.RetryClient(...)
client._client = CachedSession(...) That should give you both caching and retry features, but I haven't tested it yet. |
A better and more pythonic solution, I believe, would be to refactor both class CustomSession(RetryMixin, CacheMixin, ClientSession):
"""Session class with retry + caching features""" That might be worthwhile, because there are other features I'd like to be able to combine with |
Fyi, Closing this issue for now; let me know if the above answers your question. |
Hey! Thanks for the library, I was wondering if it's possible to use the retry and cache libraries together?
The text was updated successfully, but these errors were encountered: