Skip to content
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 invalidations (standalone) #3089

Merged
merged 13 commits into from
Jan 1, 2024

Conversation

dvora-h
Copy link
Collaborator

@dvora-h dvora-h commented Dec 23, 2023

Pull Request check-list

Please make sure to review and check all of these items:

  • Do tests and lints pass with this change?
  • Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Is there an example added to the examples folder (if applicable)?
  • Was the change added to CHANGES file?

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.

@codecov-commenter
Copy link

codecov-commenter commented Dec 23, 2023

Codecov Report

Attention: 18 lines in your changes are missing coverage. Please review.

Comparison is base (f6a4b49) 91.17% compared to head (5fd31c7) 91.49%.

Files Patch % Lines
redis/asyncio/client.py 86.27% 7 Missing ⚠️
redis/_parsers/resp3.py 80.64% 6 Missing ⚠️
redis/cache.py 80.00% 2 Missing ⚠️
redis/client.py 86.66% 2 Missing ⚠️
redis/cluster.py 0.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3089      +/-   ##
==========================================
+ Coverage   91.17%   91.49%   +0.31%     
==========================================
  Files         127      129       +2     
  Lines       32855    33062     +207     
==========================================
+ Hits        29956    30249     +293     
+ Misses       2899     2813      -86     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dvora-h dvora-h changed the title Client side caching invalidations (sync, standalone) Client side caching invalidations (standalone) Dec 31, 2023
redis/_parsers/resp3.py Outdated Show resolved Hide resolved
redis/cache.py Show resolved Hide resolved
redis/client.py Outdated Show resolved Hide resolved
redis/asyncio/client.py Outdated Show resolved Hide resolved
@dvora-h dvora-h marked this pull request as ready for review December 31, 2023 23:40
@dvora-h dvora-h requested a review from a team December 31, 2023 23:41
Comment on lines +128 to +138
def handle_push_response(self, response, disable_decoding, push_request):
if response[0] in _INVALIDATION_MESSAGE:
res = self.invalidation_push_handler_func(response)
else:
res = self.pubsub_push_handler_func(response)
if not push_request:
return self._read_response(
disable_decoding=disable_decoding, push_request=push_request
)
else:
return res
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it be better to test response[0] for pubsub as well (think its "message"?) and error out if its another type not supported.

if willing to force python 3.10, can use a switch/case/default stateent?

don't understand what pust_request is yet.

Comment on lines +270 to +280
async def handle_push_response(self, response, disable_decoding, push_request):
if response[0] in _INVALIDATION_MESSAGE:
res = self.invalidation_push_handler_func(response)
else:
res = self.pubsub_push_handler_func(response)
if not push_request:
return await self._read_response(
disable_decoding=disable_decoding, push_request=push_request
)
else:
return res
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

confused why this logic seems to be duplicated from above?

@dvora-h dvora-h merged commit 53de308 into redis:master Jan 1, 2024
56 checks passed
vladvildanov pushed a commit that referenced this pull request Sep 27, 2024
* cache invalidations

* isort

* deamon thread

* remove threads

* delete comment

* tests

* skip if hiredis available

* async

* review comments

* docstring

* decode test

* fix test

* fix decode response test
vladvildanov pushed a commit that referenced this pull request Sep 27, 2024
* cache invalidations

* isort

* deamon thread

* remove threads

* delete comment

* tests

* skip if hiredis available

* async

* review comments

* docstring

* decode test

* fix test

* fix decode response test
vladvildanov pushed a commit that referenced this pull request Sep 27, 2024
* cache invalidations

* isort

* deamon thread

* remove threads

* delete comment

* tests

* skip if hiredis available

* async

* review comments

* docstring

* decode test

* fix test

* fix decode response test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants