Skip to content

Instantly share code, notes, and snippets.

@balupton balupton/
Created Jan 27, 2013

What would you like to do?
Async with bal-util

Async with bal-util

# Method One
(new require('bal-util').Group(next))
		(complete) -> setTimeout(complete,500)
		(complete) -> setTimeout(complete,250)

# Method Two
var tasks = (new require('bal-util').Group(next))
tasks.push (complete) -> setTimeout(complete,500)
tasks.push (complete) -> setTimeout(complete,250)'parallel')

# Notes
# `complete` takes one argument - `err` - when passed, the flow will quite and `next` will be triggered with the error
# to run the group in serial instead of parallel use `run('serial')` - parallel is default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.