Skip to content

Support custom payload exchange #4

@micHar

Description

@micHar

Right now we only expose exchanging messages via the same methods that the original okhttp WebSocketListener uses, i.e. String and ByteString. We could introduce a mechanism similar to Retrofit Converters to exchange custom strongly typed messages. We need to consider that the request types and response type might be different, too. Also this might be a good place to introduce the EnvelopeJsonAdapter.
Basically when building the RxWebSocket we would provide the Converter Factory. And then listening to a specific type of responses would try to search for an appropriate converter to deal with the payload. Same with sending requests. Not sure if it makes sense without codegen, too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions