You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
vargroup=newTaskGroup();group.setConfig({concurrency: 1});group.addTask(function(){console.log('Running first task outside of group.');});// Add a sub-group to our exiting groupgroup.addGroup(function(){// Tell this sub-group to execute in parallel (all at once) by setting its// concurrency to unlimited by default the concurrency for all groups is set// to 1 which means that they execute in serial fashion (one after the other,// instead of all at once)this.setConfig({concurrency: 0});// Add an asynchronous task that gives its result to the completion callbackthis.addTask(function(complete){setTimeout(function(){console.log('Running asynchronous task in group.')},500);});// Add a synchronous task that returns its resultthis.addTask(function(){console.log("Running synchronous task in group.")});});group.addTask(function(){console.log('Running second task outside of group.');});group.run()
I get the following result:
Running first task outside of group.
Running synchronous task in group.
Running asynchronous task in group.
The second task outside of the group is not fired. If I configure the concurrency of the task group to 0 instead of 1, it does fire as expected.
The text was updated successfully, but these errors were encountered:
So the problem is actually a documentation problem!
// Add an asynchronous task that gives its result to the completion callback
this.addTask(function(complete){
setTimeout(function(){
console.log('Running asynchronous task in group.')
},500);
});
Doesn't call the completion callback! Therefore it hangs there.
I've created #7 for a possible way of detecting such problems.
In the following example:
I get the following result:
The second task outside of the group is not fired. If I configure the concurrency of the task group to 0 instead of 1, it does fire as expected.
The text was updated successfully, but these errors were encountered: