diff -r 322d0feea350 -r 89ef5ed3c48b src/cm/media/js/lib/yui/yui_3.10.3/api/classes/Parallel.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/cm/media/js/lib/yui/yui_3.10.3/api/classes/Parallel.html Tue Jul 16 14:29:46 2013 +0200 @@ -0,0 +1,2111 @@ + + + + + Parallel - YUI 3 + + + + + + + + +
+
+
+ +

+ +
+
+ API Docs for: 3.10.3 +
+
+
+ +
+ +
+
+
+ Show: + + + + + + + +
+ + +
+
+
+

Parallel Class

+
+ + + + + +
+ Defined in: parallel/js/parallel.js:8 +
+ + + + + Module: parallel + + + + +
+ + + +
+

A concurrent parallel processor to help in running several async functions.

+ +
var stack = new Y.Parallel();
+
+for (var i = 0; i < 15; i++) {
+    Y.io('./api/json/' + i, {
+        on: {
+            success: stack.add(function() {
+                Y.log('Done!');
+            })
+        }
+    });
+}
+
+stack.done(function() {
+    Y.log('All IO requests complete!');
+});
+
+
+ + + +
+ + +
+
+

Item Index

+ + +
+

Methods

+ +
    + +
  • + add + + + +
  • + +
  • + done + + + +
  • + +
  • + test + + + +
  • + +
+
+ + + +
+

Properties

+ + +
+ + + + + +
+ + +
+

Methods

+ + +
+

add

+ + +
+ (
    + +
  • + + fn + +
  • + +
) +
+ + + + + + + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + parallel/js/parallel.js:62 + +

+ + + + + +
+ +
+

Add a callback to the stack

+
+ + +
+

Parameters:

+ +
    + +
  • + + fn + Function + + + + +
    +

    The function callback we are waiting for

    +
    + + +
  • + +
+
+ + + + + +
+ + +
+

done

+ + +
+ (
    + +
  • + + callback + +
  • + +
  • + + data + +
  • + +
) +
+ + + + + + + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + parallel/js/parallel.js:91 + +

+ + + + + +
+ +
+

The method to call when all the items in the stack are complete.

+
+ + +
+

Parameters:

+ +
    + +
  • + + callback + Function + + + + +
    +

    The callback to execute on complete

    +
    + + +
      + +
    • + + results + Mixed + + +
      +

      The results of all the callbacks in the stack

      +
      + + +
    • + +
    • + + [data] + Mixed + optional + + +
      +

      The data given to the done method

      +
      + + +
    • + +
    + +
  • + +
  • + + data + Mixed + + + + +
    +

    Mixed data to pass to the success callback

    +
    + + +
  • + +
+
+ + + + + +
+ + +
+

test

+ + + () + + + + + + + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + parallel/js/parallel.js:81 + +

+ + + + + +
+ +
+

Test to see if all registered items in the stack have completed, if so call the callback to done

+
+ + + + + + +
+ + +
+ + + +
+

Properties

+ + +
+

finished

+ Number + + + + + + + + + +
+ + + +

+ + Defined in + + + + + parallel/js/parallel.js:56 + +

+ + + + +
+ +
+

The number of stacked callbacks executed

+
+ + + + + + +
+ + +
+

results

+ Array + + + + + + + + + +
+ + + +

+ + Defined in + + + + + parallel/js/parallel.js:43 + +

+ + + + +
+ +
+

An Array of results from all the callbacks in the stack

+
+ + + + + + +
+ + +
+

total

+ Number + + + + + + + + + +
+ + + +

+ + Defined in + + + + + parallel/js/parallel.js:50 + +

+ + + + +
+ +
+

The total items in the stack

+
+ + + + + + +
+ + +
+ + + + + +
+
+ +
+
+
+
+
+
+ + + + + + + + + +