I am using scala 2.10, and I am wondering if there is some kind of package with asynchronous IO when working with files?
I did a search on this topic, but basically found examples, as shown below.
val file = new File(canonicalFilename) val bw = new BufferedWriter(new FileWriter(file)) bw.write(text) bw.close()
what is essentially a java.io package with blocking I / O operations - write, read, etc. I also found a scala-io project with this intention, but it seems that the project is dead in the last activity of 2012.
What is the best practice in this scenario? Is there any scala package or a general way to wrap java.io code for futures and observations?
My use case from actor Akki is to manipulate files in a local or remote file system. Blocking must be avoided. Or is there a better alternative?
Thnaks for clarifying this
source share