Skip to content

Instantly share code, notes, and snippets.

@jadlr
Created October 2, 2020 12:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jadlr/17cf58e6956c07430550c4a34c0632b2 to your computer and use it in GitHub Desktop.
Save jadlr/17cf58e6956c07430550c4a34c0632b2 to your computer and use it in GitHub Desktop.
Unexpected behaviour when using zio with fs2
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