Created
October 2, 2020 12:36
-
-
Save jadlr/17cf58e6956c07430550c4a34c0632b2 to your computer and use it in GitHub Desktop.
Unexpected behaviour when using zio with fs2
This file contains 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 fs2.Stream | |
import zio.interop.catz._ | |
import zio.{ Runtime, Task } | |
object FS2TaskInterop extends App { | |
val runtime = Runtime.default | |
val nonStream = Task(123).map(_ => BigDecimal("16:19:25.242056065Z")) | |
val stream = Stream.eval(nonStream) | |
// prints the `zio.Exit.Failure` | |
println(runtime.unsafeRun(nonStream.run)) | |
// throws a `FiberFailure` | |
println(runtime.unsafeRun(stream.attempt.compile.toList)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment