Simple question: you have a faucet and a drain and you want to get the water 
from one to the other without spilling any, how do you do that? Of course you 
connect the two with a hose, and you do so while making sure that everything is 
tight. That way the pressure in the faucet will be relieved only through the 
drain, but the drain can limit how much water flows through the whole 
system—through back-pressure.

Akka HTTP is built on Streams for exactly this reason, a Flow is a watertight 
connection between a Sink and a Source. If you build your solution with these 
elements then not water is spilt (and no kittens die).

Sink.actorRef corresponds to leaving the end of the hose open and unconnected, 
placing a bucket below it that will hopefully catch most of the water.

So, to conclude: if you want to use our nice and watertight websockets, then 
you’ll have to use hoses (Streams) and not hammers (Actors). Of course you can 
use a hammer to build a “hose” but that will be a lot of work since you’ll 
effectively be smithing a manifold.

Regards,

Roland

> 26 maj 2015 kl. 18:41 skrev Sam Halliday <sam.halli...@gmail.com>:
> 
> Hi all,
> 
> I have another thread about retrofitting wandoulabs websockets to use 
> akka-io, which is proving painful, but I wanted to separate out this aspect 
> of the questioning.
> 
> Before I invest any more time into it, I'd like to know if the new websockets 
> implementation actually implements backpressure on the server and client 
> side, for both reading and writing from the socket (there are four channels 
> requiring backpressure in a single client/server connection).
> 
> 
> Even if the implementation has backpressure at the IO level, it looks like 
> the only way to create a Flow from an Actor is via Sink.actorRef (plus some 
> other magic with Sources and the DSL that I haven't figured out yet) ... and 
> that explicitly says in the documentation
> 
>    "there is no back-pressure signal from the destination actor, i.e. if the 
> actor is not consuming the messages fast enough the mailbox of the actor will 
> grow"
> 
> which means that passing off to an actor backend to implement the websockets 
> server is ultimately not going to have any backpressure when reading off the 
> socket.
> 
> I don't know what the situation is for writing to the socket, but certainly 
> this is something that my current backend library is able to handle.
> 
> 
> So is this reactive, or what?
> 
> 
> 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/
>>>>>>>>>>      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.

Reply via email to