YUI({
//Last Gallery Build of this module
gallery: 'gallery-2012.06.20-20-07'
}).use('gallery-async', function(Y) {
// Each command depends on the previous command so they are executed one-by-one in order.
// For this example, each command is a simple Y.later with a random wait time.
var result = [];
Y.Async.runQueue(function (success) {
Y.later(Math.floor(Math.random() * 1000), null, function () {
result.push(1);
success();
});
}, function (success) {
Y.later(Math.floor(Math.random() * 1000), null, function () {
result.push(result[0] + 2);
success();
});
}, function (success) {
Y.later(Math.floor(Math.random() * 1000), null, function () {
result.push(result[1] + 3);
success();
});
}, function (success) {
Y.later(Math.floor(Math.random() * 1000), null, function () {
result.push(result[2] + 4);
success();
});
}, function (success) {
Y.later(Math.floor(Math.random() * 1000), null, function () {
result.push(result[3] + 5);
success();
});
}).on('complete', function () {
alert(result[4]);
});
// Each command is independent and does not rely upon other commands.
// The commands are all executed immediately.
// Once all commands have completed, the application continues and has valid
// data provided by all commands.
// For this example, each command is a simple Y.later with a random wait time.
var a, b, c, d, e;
Y.Async.runAll(function (success) {
Y.later(Math.floor(Math.random() * 5000), null, function () {
a = 1;
success();
});
}, function (success) {
Y.later(Math.floor(Math.random() * 5000), null, function () {
b = 2;
success();
});
}, function (success) {
Y.later(Math.floor(Math.random() * 5000), null, function () {
c = 3;
success();
});
}, function (success) {
Y.later(Math.floor(Math.random() * 5000), null, function () {
d = 4;
success();
});
}, function (success) {
Y.later(Math.floor(Math.random() * 5000), null, function () {
e = 5;
success();
});
}).on('complete', function () {
alert(a + b + c + d + e);
});
});/home/y/libexec/ant/bin/ant all
Buildfile: build.xml
[echo] Starting Build For gallery-async
clean:
init:
[mkdir] Created dir: /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-async/build_tmp
[echo] Starting Build For gallery-async
-lint-server:
[echo] Starting Build For gallery-async
-node:
[echo] For faster builds, install Node.js.
-concatdebug:
[copy] Copying 1 file to /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-async/build_tmp/ant
[delete] Deleting directory /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-async/build_tmp/ant
-registerdebug:
[copy] Copying 1 file to /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-async/build_tmp
-prependdebug:
-appenddebug:
builddebug:
-createcore:
[copy] Copying 1 file to /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-async/build_tmp
-loggerregex:
buildcore:
-rollupjs:
-concatskins:
-buildskins:
-rollupcss:
buildskins:
-buildlangs:
-rolluplangs:
buildlangs:
build:
minify:
[yuicompressor] Compressing /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-async/build_tmp/gallery-async.js
[yuicompressor]
[yuicompressor] [WARNING] Invalid hint syntax: use strict
[yuicompressor] {(function(Y,moduleName){ ---> "use strict" <--- ;var _string_complete="complete",_string_initOnly="initOnly",
[yuicompressor] Compressed to /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-async/build_tmp/gallery-async-min.js
lint:
[echo] Using Rhino. Install nodejs to improve jslint speed, or skip with -Dlint.skip=true
[java] Running JSLint on : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-async/build_tmp/gallery-async.js
[java] - OK
local:
deploybuild:
[copy] Copying 3 files to /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/build/gallery-async
deployassets:
deployskins:
deploylang:
deploydocs:
deploy:
all:
BUILD SUCCESSFUL
Total time: 2 seconds
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info