Channel:pop
Pops a message from the Channel. If the Channel is empty, an optional timeout argument can be used to wait for a message, otherwise nil
is returned.
message = Channel:pop(wait)
Arguments
Name | Type | Default | Description |
wait | number | false | How long to wait for a message to be popped, in seconds. true can be used to wait forever and false can be used to avoid waiting.
|
Returns
Name | Type | Description |
message | * | The received message, or nil if nothing was received.
|
Notes
Threads can get stuck forever waiting on Channel messages, so be careful.
See also
Channel:peek
Channel:push
Channel