{"action":"closed","issue":{"url":"https://api.github.com/repos/kevinswiber/pipeworks/issues/7","labels_url":"https://api.github.com/repos/kevinswiber/pipeworks/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/kevinswiber/pipeworks/issues/7/comments","events_url":"https://api.github.com/repos/kevinswiber/pipeworks/issues/7/events","html_url":"https://github.com/kevinswiber/pipeworks/issues/7","id":61148989,"number":7,"title":"Callback error when using async with pipe siphon","user":{"login":"theganyo","id":772731,"avatar_url":"https://avatars.githubusercontent.com/u/772731?v=3","gravatar_id":"","url":"https://api.github.com/users/theganyo","html_url":"https://github.com/theganyo","followers_url":"https://api.github.com/users/theganyo/followers","following_url":"https://api.github.com/users/theganyo/following{/other_user}","gists_url":"https://api.github.com/users/theganyo/gists{/gist_id}","starred_url":"https://api.github.com/users/theganyo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theganyo/subscriptions","organizations_url":"https://api.github.com/users/theganyo/orgs","repos_url":"https://api.github.com/users/theganyo/repos","events_url":"https://api.github.com/users/theganyo/events{/privacy}","received_events_url":"https://api.github.com/users/theganyo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-13T17:27:46Z","updated_at":"2015-03-13T20:11:41Z","closed_at":"2015-03-13T20:11:41Z","body":"Here is a test script that recreates the issue:\r\n\r\n``` javascript\r\n'use strict';\r\n \r\nvar async = require('async');\r\nvar pipeworks = require('pipeworks');\r\n \r\nvar context = {}, tasks = {};\r\nvar taskNames = ['foo', 'bar']\r\n \r\nvar pipe = \r\n  pipeworks()\r\n    .fit(function startParallel(context, next) {\r\n      console.log('siphoned pipe');\r\n      next(context);\r\n    });\r\n \r\ntaskNames.forEach(function(name) {\r\n  tasks[name] = createTask(context, pipe, name);\r\n});\r\n \r\nconsole.log('starting parallel 1');\r\nasync.parallel(tasks, function(err, result) {\r\n  console.log('parallel 1 done');  \r\n \r\n  console.log('starting parallel 2');\r\n  async.parallel(tasks, function(err, result) {\r\n    console.log('parallel 2 done');  \r\n  });\r\n});\r\n \r\nfunction createTask(context, pipe, name) {\r\n \r\n  return function execTask(cb) {\r\n    console.log('execTask: %s', name);\r\n    \r\n    pipeworks()\r\n      .fit(function startParallel(context, next) {\r\n        console.log('starting parallel pipe: %s', name);\r\n        pipe.siphon(context, next);\r\n      })\r\n      .fit(function finishParallel(context, next) {\r\n        console.log('finished parallel pipe: %s', name);\r\n        cb(null, 'result');\r\n      })\r\n      .flow(context);\r\n  }\r\n}\r\n```"}}