Hi Sam, it might be better to take a step back before potentially running in the wrong direction. First off, Akka HTTP offers a complete solution for everything HTTP (including websockets) within an ActorSystem. Before deciding to combine this with another tool I recommend that you explore first how Akka HTTP works, because it introduces several fundamentally new concepts. In particular, when talking about it as “Spray 2.0” it is important to note that everything ActorRef-related in Spray has been replaced by Streams—a completely different abstraction that is not an Actor. The whole underpinnings are completely rewritten in a radically different fashion, so don’t expect any Spray modules that live “beneath the surface” to seamlessly fit onto Akka HTTP.
We could go into the details Wandoulabs’ websocket add-on, but I don’t see much value in discussing that before the basics are clear. The other piece of information that I’m lacking is why you would want to “retrofit” something in this context, it might be better to explain the ends and not the means in order to get help. Regards, Roland > 23 maj 2015 kl. 12:38 skrev Sam Halliday <[email protected]>: > > Hi all, > > I'm very excited that akka-io now has WebSocket support. > > In ENSIME, we're planning on using this wrapper over wandoulab's websockets > > https://github.com/smootoo/simple-spray-websockets > > to easily create a REST/WebSockets endpoint with JSON marshalling for a > sealed family, with backpressure. > > Smootoo's wrapper works really well, and I have had the pleasure of using it > in a corporate environment so I trust it to be stable. > > > For future proofing, it would seem sensible to move to stock akka-io for > WebSockets, so I'm considering sending a PR to retrofit the wrapper. I have a > couple of questions about that: > > 1. does akka-io's HTTP singleton actor support WebSockets now? That was the > big caveat about using wandoulabs. It means all kinds of workarounds if you > want to just use HTTP in the same actor system. > > 2. is there a migration guide for wandoulabs to akka-io? Or would it be best > just to rewrite the wrapper from scratch on top of akka-io? > > 3. where is the documentation? This just has a big TODO on it > > > http://doc.akka.io/docs/akka-stream-and-http-experimental/1.0-RC3/scala/http/client-side/websocket-support.html > > http://doc.akka.io/docs/akka-stream-and-http-experimental/1.0-RC3/scala/http/routing-dsl/websocket-support.html > > I can't even find any examples. I guess the key thing is the handshaking, > which would mean rewriting this bit (and the corresponding client side > handshake) > > > https://github.com/smootoo/simple-spray-websockets/blob/master/src/main/scala/org/suecarter/websocket/WebSocket.scala#L167 > > Best regards, > Sam > > -- > >>>>>>>>>> Read the docs: http://akka.io/docs/ <http://akka.io/docs/> > >>>>>>>>>> Check the FAQ: > >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html > >>>>>>>>>> <http://doc.akka.io/docs/akka/current/additional/faq.html> > >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user > >>>>>>>>>> <https://groups.google.com/group/akka-user> > --- > You received this message because you are subscribed to the Google Groups > "Akka User List" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <mailto:[email protected]>. > To post to this group, send email to [email protected] > <mailto:[email protected]>. > Visit this group at http://groups.google.com/group/akka-user > <http://groups.google.com/group/akka-user>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. Dr. Roland Kuhn Akka Tech Lead Typesafe <http://typesafe.com/> – Reactive apps on the JVM. twitter: @rolandkuhn <http://twitter.com/#!/rolandkuhn> -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
