scala - What is the current state of asynchronous file IO in akka streams? -


target:

i see akka's file io asynchronous , non-blocking possible.

my status of knowledge far:

in older project documentation can read this:

note

since current version of akka (2.3.x) needs support jdk6, provided file io implementations not able utilise asynchronous file io operations, these introduced in jdk7 (and newer). once akka free require jdk8 (from 2.4.x) these implementations updated make use of new nio apis (i.e. asynchronousfilechannel).

the current akka version '2.5.4'. current version of akka-stream '2.11' or '2.12'. in current documentation note abhove missing , explicitly mentioned file io means blocking operations processed dispatcher dedicated io operations.

in 'manifest.mf' file inside akka-streams jar-file there line:

require-capability: osgi.ee;filter:="(&(osgi.ee=javase)(version=1.8))" 

so guess requires java 8.

there a question related scala asynchronous file io january 2015. one of answers contains:

akka io, while not providing file io in it's core, has module developed dario rexin, allows use asynchronousfilechannel akka io in simple manner. have @ library make use of it: https://github.com/drexin/akka-io-file

questions:

  1. how asynchronous current state of akka streams file io?
  2. does akka streams file io use 'asynchronousfilechannel' java's nio?
  3. do have use 'asynchronousfilechannel' java's nio?

  1. how asynchronous current state of akka streams file io?

perusing source code shows akka stream's fileio uses java.nio.bytebuffer , java.nio.channels.filechannel. , documentation states, file io operations run in isolation on dedicated dispatcher.

there open pull request attempts use asynchronousfilechannel. based on benchmark results reported in pr, pr might closed in favor of trying newer approach synchronous nio captured in pr.

  1. does akka streams file io use 'asynchronousfilechannel' java's nio?

no.

  1. do have use 'asynchronousfilechannel' java's nio?

this question moot, because akka streams not use asynchronousfilechannel.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -