Skip to content

Toggle response encoding and decoding #1732

Closed
@chayim

Description

@chayim

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions