Difference between revisions of "Parallel (API)"

From ComputerCraft Wiki
Jump to: navigation, search
(Updated to API overview v2)
(use API table template)
Line 2: Line 2:
 
Parallel is an API which allows you to multitask.
 
Parallel is an API which allows you to multitask.
  
<table style="width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;">
+
{{API table|Parallel|image=Grid disk.png|2=
<tr><td colspan="2" style="font-weight: bold; font-size: large; padding-bottom: .3em; border-bottom: solid #C9C9C9 1px; background: #D3FFC2; line-height:28px;">
+
[[File:Grid_disk.png|24px]]&nbsp;&nbsp;
+
Parallel (API)
+
</td></tr>
+
  
<tr><td style="width: 350px; background: #E0E0E0; padding: .4em; font-weight:bold;">Method Name</td><td style="background: #E0E0E0; padding: .4em; font-weight:bold;">Description</td></tr>
+
{{API table/row
 +
|[[parallel.waitForAny]](function1, function2, ...)|{{type|nil}}
 +
|Runs all the functions at the same time, and stops when any of them returns.
 +
|odd}}
  
<tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[parallel.waitForAny]](function1, function2, ...)</td>
+
{{API table/row
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Runs all the functions at the same time, and stops when any of them returns.</td></tr>
+
|[[parallel.waitForAll]](function1, function2, ...)|{{type|nil}}
 +
|Runs all the functions at the same time, and stops when all of them have returned.
 +
|}}
  
<tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[parallel.waitForAll]](function1, function2, ...)</td>
+
}}
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Runs all the functions at the same time, and stops when all of them have returned.</td></tr>
+
 
+
</table>
+
  
  
 
[[Category:APIs]]
 
[[Category:APIs]]

Revision as of 21:50, 14 September 2013

Parallel is an API which allows you to multitask.

Grid disk.png  Parallel (API)
Function Return values Description
parallel.waitForAny(function1, function2, ...) nil Runs all the functions at the same time, and stops when any of them returns.
parallel.waitForAll(function1, function2, ...) nil Runs all the functions at the same time, and stops when all of them have returned.