https://kotlinlang.org logo
#coroutines
Title
# coroutines
e

elizarov

04/15/2020, 4:51 PM
📣📣 📣 Rethinking atomic cancellation in channels: For a good reason we propose to introduce a breaking change in one corner-case of
kotlinx.coroutines
library in the next major release. It concerns "atomic cancellation" behavior of
Channel
send
and
receive
functions. It might affect your code if you've ever used channels to transfer resources (references that need to be closed, like open files, sockets, etc) between coroutines via channels and if you were relying on those guarantees to ensure that the corresponding resource get closed by either sender or receiver and thus never leaks. If this is the case, then, please, study the details of the proposed change and voice your concern if the change is going to negatively affect the code you maintain: https://github.com/Kotlin/kotlinx.coroutines/issues/1813
👀 10
👍 2
👌 7
There's also an additional, very minor change that is related to this one and it concerns the behavior of `CancellableContinuation.invokeOnCancellation`: https://github.com/Kotlin/kotlinx.coroutines/issues/1915
4 Views