Propagate Java thread interruption in Dispatcher#unsafeRunSync#4167
Conversation
armanbilge
left a comment
There was a problem hiding this comment.
We should also make a similar change for IO#unsafeRunSync.
tests/jvm/src/test/scala/cats/effect/std/DispatcherJVMSpec.scala
Outdated
Show resolved
Hide resolved
tests/jvm/src/test/scala/cats/effect/std/DispatcherJVMSpec.scala
Outdated
Show resolved
Hide resolved
tests/jvm/src/test/scala/cats/effect/std/DispatcherJVMSpec.scala
Outdated
Show resolved
Hide resolved
tests/jvm/src/test/scala/cats/effect/std/DispatcherJVMSpec.scala
Outdated
Show resolved
Hide resolved
I got a bit lost trying to comprehend the nuanced |
Actually, maybe let's hold off on that change. I forgot that the specification for this method is a bit unusual. cats-effect/core/jvm/src/main/scala/cats/effect/IOPlatform.scala Lines 45 to 48 in 725a4cd But if we did decide to move forward ... DetailsYou can factor out a package-private version of cats-effect/core/shared/src/main/scala/cats/effect/IO.scala Lines 979 to 992 in 725a4cd Then, you can use that for cancelation in cats-effect/core/jvm/src/main/scala/cats/effect/IOPlatform.scala Lines 79 to 85 in 725a4cd |
Co-authored-by: Arman Bilge <[email protected]>
If only you are ok with the resulting discrepancy in sematics between |
Dispatcher#unsafeRunSync
Closes #4166.