Skip to content

Give raw string bytes in socket message instead of string #11763

@projects2080

Description

@projects2080

Is your feature request related to a problem?

For very high performance websocket clients it is sometimes not desirable to automatically convert bytes to string, even if the server sends as string. It's unnecessary overhead when using high performance json parsing like orjson which can handle bytes faster.

Describe the solution you'd like

A flag that allows me to opt in to receiving bytes of string instead of actual python string.

Describe alternatives you've considered

Switch to synchronous websocket client (already supports this).

Related component

Client

Additional context

No response

Code of Conduct

  • I agree to follow the aio-libs Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions