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

WebSockets should use standard marshallers via TextMessage #281

Open
akka-ci opened this issue Sep 12, 2016 · 1 comment
Open

WebSockets should use standard marshallers via TextMessage #281

akka-ci opened this issue Sep 12, 2016 · 1 comment
Labels
1 - triaged Tickets that are safe to pick up for contributing in terms of likeliness of being accepted help wanted Identifies issues that the core team will likely not have time to work on t:websocket

Comments

@akka-ci
Copy link

akka-ci commented Sep 12, 2016

Issue by fommil
Sunday Jul 12, 2015 at 11:36 GMT
Originally opened as akka/akka#17969


When using the new handleWebsocketMessages it is probably pretty reasonable to expect that the same marshallers will be used here as in the REST API (and at least the user could provide an implicit ToResponseMarshallable in the scope). However, handleWebsocketMessages expects a Flow[Message, Message, _] which demands that users manually implement the marshalling.

This results in this level of boilerplate:

        val flow = Flow[Message].collect {
          case TextMessage.Strict(msg) =>
            msg.parseJson.convertTo[RpcRequestEnvelope]
          // ignores everything else
        }.via(Flow.wrap(sink, source)((_, _) => ())).map {
          case e: RpcResponseEnvelope =>
            TextMessage.Strict(e.toJson.prettyPrint): Message
        }
@akka-ci akka-ci added this to the 2.4.x milestone Sep 12, 2016
@akka-ci
Copy link
Author

akka-ci commented Sep 12, 2016

Comment by ktoso
Tuesday Oct 20, 2015 at 11:47 GMT


Agree that we should the marshalling infra work well with WS.

@ktoso ktoso removed this from the 2.4.x milestone Sep 12, 2016
@raboof raboof added help wanted Identifies issues that the core team will likely not have time to work on 1 - triaged Tickets that are safe to pick up for contributing in terms of likeliness of being accepted t:websocket labels Jun 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 - triaged Tickets that are safe to pick up for contributing in terms of likeliness of being accepted help wanted Identifies issues that the core team will likely not have time to work on t:websocket
Projects
None yet
Development

No branches or pull requests

3 participants