Retrieves and removes an element from this channel if it's not empty, or suspends the caller while the channel is empty, or throws a ClosedReceiveChannelException if the channel is closed for
receive. If the channel was closed because of an exception, it is called a failed channel and this function will throw the original close cause exception.
This suspending function is cancellable. If the Job of the current coroutine is cancelled or completed while this function is suspended, this function immediately resumes with a CancellationException. There is a prompt cancellation guarantee. If the job was cancelled while this function was suspended, it will not resume successfully. The
receive call can retrieve the element from the channel, but then throw CancellationException, thus failing to deliver the element. See "Undelivered elements" section in Channel documentation for details on handling undelivered elements.