{{newin|[[0.9.0]]|090|type=function}}
Retrieves the value of a Channel message and removes it from the message queue.

It waits until a message is in the queue then returns the message value.
== Function ==
=== Synopsis ===
<source lang="lua">
value = Channel:demand( )
</source>
=== Arguments ===
None.
=== Returns ===
{{param|Variant|value|The contents of the message.}}

== Function ==
{{newin|[[11.0]]|110|type=variant}}
=== Synopsis ===
<source lang="lua">
value = Channel:demand( timeout )
</source>
=== Arguments ===
{{param|number|timeout|The maximum amount of time to wait.}}
=== Returns ===
{{param|Variant|value|The contents of the message or nil if the timeout expired.}}
== See Also ==
* [[parent::Channel]]
* [[Channel:supply]]
* [[Channel:pop]]
[[Category:Functions]]
{{#set:Description=Wait for and retrieve the value of a Channel message.}}
== Other Languages ==
{{i18n|Channel:demand}}