Re: [akka-user] Closing resources in the Akka Stream

2015-05-31 Thread Konrad Malawski
Looks good Petr! No, we do not have a built-in combinator like this, I can see it being useful so perhaps it's worth rising an issue on akka/akka https://github.com/akka/akka/issues/new, if you'd have a moment to spare to explain the use case in a ticket - thanks! On Sat, May 30, 2015 at 10:09

Re: [akka-user] Closing resources in the Akka Stream

2015-05-30 Thread Petr Janda
Hi Konrad, thanks for elaboration and advice about io.Source. I've heard that io.Source had some design flaws but wasn't sure what it was specifically. Will try your suggestion. Regarding the Flow, what you suggest is very close to what I've end up doing, as I've made a Flow which effectively

Re: [akka-user] Closing resources in the Akka Stream

2015-05-29 Thread Konrad Malawski
Hi Petr, Firstly - do not use the io.Source + getLines trick to get lines from a File, it's horribly slow :-) Instead use the SynchronousFileSource*as shown in stream-io.html#Streaming_File_IO http://doc.akka.io/docs/akka-stream-and-http-experimental/1.0-RC3/scala/stream-io.html#Streaming_File_IO

[akka-user] Closing resources in the Akka Stream

2015-05-26 Thread Petr Janda
Hi guys, I was wondering what is the best practice used in Akka Streams to clean up opened resources. My example use case is the stream reading lines from the file, streaming them to Apache Kafka (using https://github.com/softwaremill/reactive-kafka subscriber). See the example code here: