Difference between revisions of "Parallel (API)"

From ComputerCraft Wiki
Jump to: navigation, search
m
(Updated to API overview v2)
Line 1: Line 1:
 +
 
Parallel is an API which allows you to multitask.
 
Parallel is an API which allows you to multitask.
{| border="1" cellpadding="2" cellspacing="0"
+
 
!style="background:#EEE" width="200px"|Method name
+
<table style="width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;">
!style="background:#EEE" width="*"|Description
+
<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.waitForAny]](function1, function2, ...)
+
Parallel (API)
|Runs all the functions at the same time, and stops when any of them returns.
+
</td></tr>
|-
+
 
|[[parallel.waitForAll]](function1, function2, ...)
+
<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>
|Runs all the functions at the same time, and stops when all of them have returned.
+
 
|}
+
<tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[parallel.waitForAny]](function1, function2, ...)</td>
 +
<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>
 +
 
 +
<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 22:21, 30 November 2012

Parallel is an API which allows you to multitask.

Grid disk.png   Parallel (API)

Method NameDescription
parallel.waitForAny(function1, function2, ...) Runs all the functions at the same time, and stops when any of them returns.
parallel.waitForAll(function1, function2, ...) Runs all the functions at the same time, and stops when all of them have returned.