Channel:push

Pushes a message onto the Channel. The following types of data can be pushed: nil, boolean, number, string, and userdata. Tables should be serialized to strings.

id, read = Channel:push(message, wait)

Arguments

NameTypeDefaultDescription
message* The message to push.
waitnumberfalse How long to wait for the message to be popped, in seconds. true can be used to wait forever and false can be used to avoid waiting.

Returns

NameTypeDescription
idnumber The ID of the pushed message.
readboolean Whether the message was read by another thread before the wait timeout.

Notes

Threads can get stuck forever waiting on Channel messages, so be careful.

See also