Skip to content

Instantly share code, notes, and snippets.

@Raynos
Created November 6, 2012 23:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Raynos/4028488 to your computer and use it in GitHub Desktop.
Save Raynos/4028488 to your computer and use it in GitHub Desktop.

Execute

Execute in parallel like a true mobster

Example

execute({
    "steve": function (callback) {
        shootHimInTheFace(callback)
    },
    "james": function (callback) {
        pushHimInTheBlender(callback)
    }
}, function (err, corpses) {
    if (err) {
        return executeHenchman()
    }

    dispose(corpses)
})
var map = require("map-async")
module.exports = execute
function execute(hash, callback) {
map(hash, call, callback)
}
function call(f, callback) {
f(callback)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment