Well, I ask, because I expected a `ClosedSendChann...
# coroutines
u
Well, I ask, because I expected a `ClosedSendChannelException`on next send operation as is documented in the API docs, but I don't get to the next send operation but get a JobCanceledException before https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-send-channel/close.html
Copy code
A channel that was closed without a cause throws ClosedSendChannelException on attempts to send or receive. A channel that was closed with non-null cause is called a failed channel. Attempts to send or receive on a failed channel throw the specified cause exception.
Documentation for
produce
mentions:
Copy code
The running coroutine is cancelled when its receive channel is cancelled.
But does not talk about the SendChannel being closed
Solved: The Cancelation was actually caused by the consumer closing the ReceiveChannel, triggered by the SendChannel being closed.