当在已关闭的 Channel
上调用 receive
时会抛出此异常
my = Channel.new;.close;.receive; # Cannot receive a message on a closed channelCATCH ;# OUTPUT: «X::Channel::ReceiveOnClosed: Cannot receive a message on a closed channel»
方法§
方法 channel§
method Channel(X::Channel::ReceiveOnClosed: --> Channel)
返回调用 receive
方法的 Channel 对象。