Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

async library for javascript

branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

README.md

Async

async library for javascript

code sample:

var async = new Async();
function fun1() {
    var num = arguments[0];
    var time = arguments[1];
    setTimeout(
        function () {
            console.log(num);
            async.callback();
        }, time);
}
async.series(fun1.bind(null, 1, 1000));
async.series(fun1.bind(null, 2, 2000));
async.series(fun1.bind(null, 3, 1000));
async.series(fun1.bind(null, 4, 5000));
async.series(fun1.bind(null, 5, 1000));

http://jsfiddle.net/c7KqT/2/

var async=new Async();
function fun1() {
    var num = arguments[0];
    Repeat((function (num) {
        console.log(num);
    }).bind(null, num))
    .every(1, 's')
    .for(3, 's')
    .start
    .now()
    .then(function () {
        async.callback();
    });
}
async.series(fun1.bind(null,1));
async.series(fun1.bind(null,2));
async.series(fun1.bind(null,3));
async.series(fun1.bind(null,4));
async.series(fun1.bind(null,5));

http://jsfiddle.net/c7KqT/1/

Something went wrong with that request. Please try again.