Difference between revisions of "Channel"

m
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{newin|[[0.9.0]]|090|type=type}}
 
{{newin|[[0.9.0]]|090|type=type}}
A channel is a way to send and receive data to and from different threads.
+
An object which can be used to send and receive data between different threads.
  
 
== Constructors ==
 
== Constructors ==
Line 15: Line 15:
 
}}
 
}}
 
== Functions ==
 
== Functions ==
{{#ask: [[Category:Functions]] [[parent::Channel||Object]]
+
{{#ask: [[Category:Functions]] [[parent::Channel||Object]] [[Concept:Current]]
 
| headers=hide
 
| headers=hide
 
| format=template
 
| format=template
Line 30: Line 30:
 
* [[parent::love.thread]]
 
* [[parent::love.thread]]
 
[[Category:Types]]
 
[[Category:Types]]
{{#set:Description=A Channel represents a thread channel.}}
+
{{#set:Description=An object which can be used to send and receive data between different threads.}}
 
== Other Languages ==
 
== Other Languages ==
 
{{i18n|Channel}}
 
{{i18n|Channel}}
 
@todo: add [[Concept:Current]] to #ask queries when done adding stuffs.
 

Latest revision as of 04:11, 4 October 2015

Available since LÖVE 0.9.0
This type is not supported in earlier versions.

An object which can be used to send and receive data between different threads.

Constructors

love.thread.getChannel Creates or retrieves a named thread channel. Added since 0.9.0
love.thread.newChannel Creates a new unnamed thread channel. Added since 0.9.0

Functions

Channel:clear Clears all the messages in the Channel queue. Added since 0.9.0
Channel:demand Wait for and retrieve the value of a Channel message. Added since 0.9.0
Channel:getCount Retrieves the number of messages in the Channel queue. Added since 0.9.0
Channel:hasRead Gets whether a pushed value has been popped or otherwise removed from the Channel. Added since 11.0
Channel:peek Receive a message from a thread Channel, but leave it in the queue. Added since 0.9.0
Channel:performAtomic Executes the specified function atomically with respect to this Channel. Added since 0.10.0
Channel:pop Retrieve the value of a Channel message. Added since 0.9.0
Channel:push Send a message to a thread Channel. Added since 0.9.0
Channel:supply Send a message to a thread Channel and wait for a thread to accept it. Added since 0.9.0
Object:release Immediately destroys the object's Lua reference. Added since 11.0
Object:type Gets the type of the object as a string.
Object:typeOf Checks whether an object is of a certain type.

Supertypes

See Also

Other Languages