Created
November 22, 2019 16:48
-
-
Save vigoo/b810d76dfe166323bd8421a77c403c42 to your computer and use it in GitHub Desktop.
prox 2/14
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
val customPipe: Pipe[IO, Byte, Byte] = | |
(s: Stream[IO, Byte]) => s | |
.through(text.utf8Decode) | |
.through(text.lines) | |
.map(_.split(' ').toVector) | |
.map(v => v.map(_ + " !!!").mkString(" ")) | |
.intersperse("\n") | |
.through(text.utf8Encode) | |
val proc = Process("echo", List("This is a test string")) | |
.via(customPipe) | |
.to(Process("wc", List("-w")) > text.utf8Decode[IO]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment