fs2 icon indicating copy to clipboard operation
fs2 copied to clipboard

parEvalMap resets stream cancellation

Open enlait opened this issue 1 year ago • 1 comments

fs2 version 3.10.2

this codes prints Succeeded

Stream
  .eval(IO.canceled)
  .parEvalMap(2)(_ => IO.unit)
  .onFinalizeCase(c => IO.delay(println(c)))
  .compile.drain

while using evalMap instead, it is properly Canceled:

Stream
  .eval(IO.canceled)
  .evalMap(_ => IO.unit)
  .onFinalizeCase(c => IO.delay(println(c)))
  .compile.drain

expected behavior: I would expect cancellation in both cases.

enlait avatar Oct 01 '24 15:10 enlait

My bad, it may be a duplicate of https://github.com/typelevel/fs2/issues/3311 Though example in that issue is somewhat convoluted

enlait avatar Oct 02 '24 07:10 enlait