-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Client Side Caching: Alpha support #3038
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.
@dvora-h see comments
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #3038 +/- ##
==========================================
- Coverage 91.33% 91.16% -0.18%
==========================================
Files 126 127 +1
Lines 32719 32846 +127
==========================================
+ Hits 29884 29943 +59
- Misses 2835 2903 +68 ☔ View full report in Codecov by Sentry. |
redis/asyncio/client.py
Outdated
@@ -597,6 +597,7 @@ async def _disconnect_raise(self, conn: Connection, error: Exception): | |||
async def execute_command(self, *args, **options): | |||
"""Execute a command and return a parsed response""" | |||
await self.initialize() | |||
options.pop("keys", None) # the keys is used only for client side caching |
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.
"the keys are used only for client side caching (thoughout this PR)
@@ -0,0 +1,326 @@ | |||
import random |
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.
To keep in theme we discussed, maybe this should be redis.cache.LocalCache?
_ACCESS_COUNT = "access_count" | ||
|
||
|
||
class EvictionPolicy(Enum): |
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.
awesome
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.
One question, one change - change is only for comments
Wow, this is cool. Will the client tracking be supported in this client cache? |
@rueian Yes, we are going to add it, this is why it's just an alpha version now I hope the next version will come soon with client tracking |
Great! Can’t wait to see this powerful feature be available on redis py. This will definitely gain more acknowledgment on this feature from more developers. |
Pull Request check-list
Please make sure to review and check all of these items:
NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.
Description of change
Please provide a description of the change here.