Created
June 8, 2018 07:27
-
-
Save fuCtor/10580c28455b813019c73831de266873 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io._ | |
import monix.reactive.Observable | |
object FileReader { | |
def fileObservable(files: Seq[String]): Observable[String] = { | |
Observable.fromIterable(files).flatMap({ file => | |
Observable.fromLinesReader(new BufferedReader(new InputStreamReader(new FileInputStream(file)))) | |
.doOnSubscribe(() => println(s"START [$file]")) | |
.doOnComplete(() => println(s"FINISH [$file]")) | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment