> 27 maj 2015 kl. 08:51 skrev Sam Halliday <sam.halli...@gmail.com>: > > Hi Roland, > > I've read the documentation, several times, I've even given you feedback on > the documentation in an earlier milestone phase. Also, the documentation for > WebSockets in Akka is TODO and TODO. The documentation on the routing > directives are extremely sparse. In particular, there are no promises around > the implementation of back pressure from the new websockets. >
For this venture you need no HTTP documentation, and the documentation for Streams is complete (only lacking a translation to Java in one place). The statement “there are no promises around back-pressure” indicates that you did not, in fact, understand the full extent of what Akka Streams are. We’d love to improve the documentation in this regard, but we’d need to first figure out where their deficiency is, hence I’m talking with you. > What I'm missing is the ability to hook an existing actor system into > something that expects a Flow, with back pressure preserved. > As I hopefully explained in my other mail about hoses: your Actors would need to implement the full spec, they’d need to be watertight. This is why “simple” Sink.actorRef integration will not work if you don’t intend on spilling messages. > I understand Flow, but I don't understand the implementation in terms of > Actors (which incidentally, is exactly my primary feedback on the earlier > documentation). You're now confusing me further by saying that Streams are > not actors, because I was told at the time that streams are implemented in > terms of actors. > How we implement Flows internally should be of no consequence—suffice it to say that the project took 1.5 years because that task is genuinely hard. > In case you didn't pick up on it, I'm planning on moving away from > wandoulabs, not integrate it. This is the key piece, distilled into a > standalone problem. > In order to solve this particular problem you’ll need to carefully describe the back-pressure protocol spoken by your Actor. As Viktor suggested, an easy way to integrate is via the ask pattern, and that works because of the 1:1 correspondence between ins and outs that allow automatic back-pressure propagation. If that is not applicable then there is no generic solution. Regards, Roland > Best regards, Sam > > On 27 May 2015 7:35 am, "Roland Kuhn" <goo...@rkuhn.info > <mailto:goo...@rkuhn.info>> wrote: > 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 <sam.halli...@gmail.com >> <mailto:sam.halli...@gmail.com>>: >> >> 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 >> <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/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 >> >> <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 >> >> <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 akka-user+unsubscr...@googlegroups.com >> <mailto:akka-user+unsubscr...@googlegroups.com>. >> To post to this group, send email to akka-user@googlegroups.com >> <mailto:akka-user@googlegroups.com>. >> 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/ <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 a topic in the Google > Groups "Akka User List" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/akka-user/39HItLST7lw/unsubscribe > <https://groups.google.com/d/topic/akka-user/39HItLST7lw/unsubscribe>. > To unsubscribe from this group and all its topics, send an email to > akka-user+unsubscr...@googlegroups.com > <mailto:akka-user+unsubscr...@googlegroups.com>. > To post to this group, send email to akka-user@googlegroups.com > <mailto:akka-user@googlegroups.com>. > 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>. > > -- > >>>>>>>>>> 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 akka-user+unsubscr...@googlegroups.com > <mailto:akka-user+unsubscr...@googlegroups.com>. > To post to this group, send email to akka-user@googlegroups.com > <mailto:akka-user@googlegroups.com>. > 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 akka-user+unsubscr...@googlegroups.com. To post to this group, send email to akka-user@googlegroups.com. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.