Cc.async.parallel

Hi,

I need to execute some tasks in background without freeze/block UI.

I read documentation and found cc.async.parallel.
With example, tasks still execute sync, not async and not parallel.

My code :

cc.async.parallel([
                func1, func2
            ]);

func2 is executed only when func1 has finish.

My project’s platform is web.

Do you know how to do it / or use cc.async ?

Thanks.

So I look at cc.async.parallel this way:

cc.async.parallel([
    function(next){
        setTimeout(function(){
            console.log(0);
            next();
        }, 2000);
    }, function(next){
        console.log(1);
        next();
    }
], function(){
    console.log("end")
});

Ok i understood. // functions works. Thanks !