Hi Ryan,


On Thu, Feb 18, 2016 at 11:14 PM, Ryan Phillips <r...@trolocsis.com> wrote:

> Greetings,
>
> I've been sitting on this email for a little bit but after Владимир
> message I figured it was appropriate. My question revolves around what
> may be considered (or going to be considered) the best practice of writing
> Linux TCP servers in Akka 2.4.2+. I am new to Scala and Akka, so please
> bear with me. In my quest for research and knowledge I have come up with a
> few different scenarios that I need your input on.
>
> 1) Play: Play 2.X uses Netty for it's socket communication. Play 2.5 has
> support for Epoll on Linux and from various reports seems to be a great
> addition.
> 2) Spray: Uses the akka.io.Tcp module
> 3) Finagle: Not Akka specific, but Finagle uses Netty 3.x for networking
>
> Can someone explain the tradeoffs of going with a particular framework?
>

The reason why Akka has its own IO module is not because the others were
not good, the primary reason was that they used a programming model that
was not very friendly to actors. Hence the low level Akka.io module is
purely actor based, leveraging built-in mechanisms like watch to full
extent.

Since that, we have built Akka Streams and it has a TCP module that wraps
the underlying TCP one. It supports building fully backpressured
asynchronous pipelines, it is a nice model for IO I think.

OTOH Netty is much more focused so more resources go into its core
development, while in our case IO is one submodule of many. I think you
might achieve higher performance with Netty (simply it being a bit more low
level) but we aren't bad either, and we provide quite a bit of nice stuff
in the API.

I would say, take a look at streams, they provide a very rich programming
model very well suited for this domain, handling backpressure transparently
and supporting rich combinators and modularization.



> Does akka.io.Tcp use NIO?
>

Yes.


> Is there an intent to move directly to Akka's TCP implementation?
>

Except remoting (which was finished just before work on Akka TCP was
started -- so it still relies on Netty) everything in Akka uses our TCP
implementation. I would recommend starting with the stream based API that
hides many of the low-level details of the actor based API. You can read
about it here:
http://doc.akka.io/docs/akka/2.4.2/scala/stream/stream-io.html

But first you need to learn about how streams work, otherwise that page
might result in some frustration.

-Endre


> I'm pretty confused with all the different permutations.
>
> Best regards,
> Ryan
>
> --
> >>>>>>>>>> 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 https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
>>>>>>>>>>      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 https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to