Re: [akka-user] Asynchronous file reading

2015-07-14 Thread Konrad Malawski
The nice thing with Akka streams and a Source[ByteString, _] is that you can 
easily swap it for a different source without changing the rest of your impl :-)
The current impl uses nio.FileChannel with ByteBuffers which proved to give 
very good performance - and I've benchmarked a number of impls (file input 
streams, asynchronous file channel, file channel, and all those in combination 
with pooled byte buffers or arrays etc).

The gains that AIO gives over IO are more in terms of scalability than 
performance I think actually.
Of course it depends on access patterns, but since here we're in streaming a 
plain old scan is the best we want to have here.

All in all, sticking to SynchronousFileSource (it is blocking, however it has 
it's own dedicated, preconfigured dispatcher!) seems like a very good choice to 
me.

-- 
Cheers,
Konrad 'ktoso’ Malawski
Akka @ Typesafe

On 14 July 2015 at 21:07:31, Nicolau Werneck (nwern...@gmail.com) wrote:

I just want to make sure I am using the most promising alternative for I/O... 
I was reading files on my own with a low-level Java library, and I wasn't using 
nio yet. I wasn't sure if I was going to update it to use Java 8 stuff, try out 
akka.io, or move to akka-stream. I think I am going with Akka stream now, and I 
have already managed to adapt my project... Thanks, guys!    ++nic

On Monday, July 13, 2015 at 5:06:39 AM UTC-3, √ wrote:
I'm not sure we'll be able to take advantage of that, since all they do is to 
multiplex it on top of a given Executor.
What we could do is to create a shim over an ExecutionContext that wraps their 
submitted Runnables in BlockContext calls to isolate and make evasive actions. 
Let's discuss :)

On Mon, Jul 13, 2015 at 10:01 AM, Roland Kuhn goo...@rkuhn.info wrote:
Hi Nicolau,

this problem is not limited to Akka: most operating systems do not provide true 
asynchronous file I/O themselves. We will eventually make use of Java 8’s 
facilities (once Streams move into the master branch), but beware that the 
asynchrony of the solution depends on deployment details (JVM, O/S, …).

Regards,

Roland

13 jul 2015 kl. 02:47 skrev Nicolau Werneck nwer...@gmail.com:

What is the most current implementation of Akka based asynchronous file I/O out 
there? It seems akka-stream 1.0-RC3 still only has synchronous reading, and 
drexin's akka-io-file github repo is more than one year old. Is there no 
highly-experimental official async file IO library out there?    ++nic

--
 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+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.



Dr. Roland Kuhn
Akka Tech Lead
Typesafe – Reactive apps on the JVM.
twitter: @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+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.



--
Cheers,
√
--
 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.

-- 
  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.


Re: [akka-user] Asynchronous file reading

2015-07-14 Thread Nicolau Werneck
I just want to make sure I am using the most promising alternative for 
I/O... I was reading files on my own with a low-level Java library, and I 
wasn't using nio yet. I wasn't sure if I was going to update it to use Java 
8 stuff, try out akka.io, or move to akka-stream. I think I am going with 
Akka stream now, and I have already managed to adapt my project... Thanks, 
guys!++nic

On Monday, July 13, 2015 at 5:06:39 AM UTC-3, √ wrote:

 I'm not sure we'll be able to take advantage of that, since all they do is 
 to multiplex it on top of a given Executor.
 What we could do is to create a shim over an ExecutionContext that wraps 
 their submitted Runnables in BlockContext calls to isolate and make evasive 
 actions. Let's discuss :)

 On Mon, Jul 13, 2015 at 10:01 AM, Roland Kuhn goo...@rkuhn.info 
 javascript: wrote:

 Hi Nicolau,

 this problem is not limited to Akka: most operating systems do not 
 provide true asynchronous file I/O themselves. We will eventually make use 
 of Java 8’s facilities (once Streams move into the master branch), but 
 beware that the asynchrony of the solution depends on deployment details 
 (JVM, O/S, …).

 Regards,

 Roland

 13 jul 2015 kl. 02:47 skrev Nicolau Werneck nwer...@gmail.com 
 javascript::

 What is the most current implementation of Akka based asynchronous file 
 I/O out there? It seems akka-stream 1.0-RC3 still only has synchronous 
 reading, and drexin's akka-io-file github repo is more than one year old. 
 Is there no highly-experimental official async file IO library out there?   
  ++nic

 -- 
  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+...@googlegroups.com javascript:.
 To post to this group, send email to akka...@googlegroups.com 
 javascript:.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit 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+...@googlegroups.com javascript:.
 To post to this group, send email to akka...@googlegroups.com 
 javascript:.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




 -- 
 Cheers,
 √
  

-- 
  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.


Re: [akka-user] Asynchronous file reading

2015-07-13 Thread Roland Kuhn
Hi Nicolau,

this problem is not limited to Akka: most operating systems do not provide true 
asynchronous file I/O themselves. We will eventually make use of Java 8’s 
facilities (once Streams move into the master branch), but beware that the 
asynchrony of the solution depends on deployment details (JVM, O/S, …).

Regards,

Roland

 13 jul 2015 kl. 02:47 skrev Nicolau Werneck nwern...@gmail.com:
 
 What is the most current implementation of Akka based asynchronous file I/O 
 out there? It seems akka-stream 1.0-RC3 still only has synchronous reading, 
 and drexin's akka-io-file github repo is more than one year old. Is there no 
 highly-experimental official async file IO library out there?++nic
 
 -- 
  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.