Am Dienstag, 27. Oktober 2015 11:24:21 UTC+1 schrieb lutzh:
Hi Haddock,

Fibers as such do not prevent you from blocking. Pretty much like in Akka,
if you use blocking I/O you block the underlying thread, which is then of
course not available for other fibers or actors. So async I/O it is.
The fibers approach to it is to provide a FiberAsync wrapper, see the
section "Transforming Asynchronous Operations into Fiber-Blocking
Operations, and Fiber-Blocking IO" in the blog you refer to.

This is also a nice example for fibers value proposition - it provides
this wrapper to allow you to continue to program in a sequential /
imperative style, without using callbacks.
"without using callback". Exactly, this is the point.

This is true for fibers in general, the whole idea is that you introduce a
sub-thread level unit of concurrency, but don't change the programming
model - much like goroutines in go.
"much like goroutines in go". Yep, this is the point ;-).

When using Akka, you opted for a different model altogether already - async
messaging. Therefore I don't think it would be a good fit, it would not be
idiomatic Akka, in fact it would be a programming model contradicting
Akka's ideas.
I see the point. Agree.

To me, doing async I/O either with Future-based APIs and pipeTo, or using
Reactive Streams, seems a much better fit for Akka.
What's in the case of Akka the way to prevent threads (that is actors) from
blocking when doing blocking IO (querying databases, doing REST calls,
reading from files, etc.)? Go through NIO or is there some stuff provided
for this?

Thanks for any answers.
Regards, Haddock.

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+unsubscribe@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.

Search Discussions

Discussion Posts


Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 7 | next ›
Discussion Overview
groupakka-user @
postedOct 26, '15 at 10:39a
activeOct 28, '15 at 5:12p



site design / logo © 2022 Grokbase