class LoggingChannel

Defined in:

terminal.cr

Instance Method Summary

Instance Method Detail

def receive #
Description copied from class Channel(UInt8)

Receives a value from the channel. If there is a value waiting, then it is returned immediately. Otherwise, this method blocks until a value is sent to the channel.

Raises ClosedError if the channel is closed or closes while waiting for receive.

channel = Channel(Int32).new
spawn do
  channel.send(1)
end
channel.receive # => 1

[View source]