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

Toggle response encoding and decoding #1732

Closed
chayim opened this issue Nov 21, 2021 · 1 comment · Fixed by #1731
Closed

Toggle response encoding and decoding #1732

chayim opened this issue Nov 21, 2021 · 1 comment · Fixed by #1731
Labels
feature New feature

Comments

@chayim
Copy link
Contributor

chayim commented Nov 21, 2021

redis-py supports setting decode_responses on the creation of the main objects (i.e redis.Redis(decode_responses=True), but in many use cases, it would serve to:

  • Know whether or not the connection decodes or encodes responses
  • Toggle this behaviour

This is important for the behaviour of varying commands. Some commands (e.g. dump) should return a binary blob regardless - meaning in a connection with a decode_responses=True, one cannot call functions such as dump. Furthermore, anyone wanting to implement custom commands, is left to the mercy of the connection object(s) that have been instantiated.

Allowing the user to toggle this behaviour, means that within a given connection a user has ultimate control of behaviour in cases where they explicitly require it.

@chayim
Copy link
Contributor Author

chayim commented Dec 16, 2021

Closed by the linked PR.

@chayim chayim closed this as completed Dec 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant