Skip to content

Instantly share code, notes, and snippets.

@msuarz msuarz/async.coffee

Created Apr 27, 2012
Embed
What would you like to do?
async vs step
async.series [
(done) -> fs.writeFile '/tmp/test', 'yay', ->
console.log 'yay!!'
done null
(done) ->
console.log 'hello'
done null
-> console.log 'world'
]
step(
-> fs.writeFile '/tmp/test', 'yay', @
->
console.log 'yay!!'
@
->
console.log 'hello'
@
-> console.log 'world'
)
@jperkelens

This comment has been minimized.

Copy link

jperkelens commented Sep 19, 2012

writeFile = (done) -> fs.writeFile '/tmp/test', 'yay', ->
console.log 'yay!!'
done null
logMessage = (done) ->
console.log 'hello'
done null
anotherMessage = -> console.log 'world'

async.series [writeFile, logMessage, anotherMessage]

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.