Closing coroutine channels


#1

Could someone explain what closing a kotlinx.coroutines channel using channel.close() does and what the negative effect of not manually closing channels would be? I’ve looked at the documentation and the source code and I’m having some trouble understanding. If I don’t manually close a channel will there be some unnecessary processing? Will there be a reference to the channel somewhere that prevents it from being GCd? Or does the close function just exist as a way of informing potential users of the channel that it can no longer be used.


#2

I’ve reposted your question to StackOverflow and answered there: http://stackoverflow.com/questions/43889066/what-closing-a-kotlinx-coroutines-channel-does