{"action":"created","issue":{"url":"https://api.github.com/repos/rc0x03/node-osmosis/issues/37","labels_url":"https://api.github.com/repos/rc0x03/node-osmosis/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/rc0x03/node-osmosis/issues/37/comments","events_url":"https://api.github.com/repos/rc0x03/node-osmosis/issues/37/events","html_url":"https://github.com/rc0x03/node-osmosis/issues/37","id":93765475,"number":37,"title":"Using osmosis with multiple sites in parallel","user":{"login":"ruimgoncalves","id":1674884,"avatar_url":"https://avatars.githubusercontent.com/u/1674884?v=3","gravatar_id":"","url":"https://api.github.com/users/ruimgoncalves","html_url":"https://github.com/ruimgoncalves","followers_url":"https://api.github.com/users/ruimgoncalves/followers","following_url":"https://api.github.com/users/ruimgoncalves/following{/other_user}","gists_url":"https://api.github.com/users/ruimgoncalves/gists{/gist_id}","starred_url":"https://api.github.com/users/ruimgoncalves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruimgoncalves/subscriptions","organizations_url":"https://api.github.com/users/ruimgoncalves/orgs","repos_url":"https://api.github.com/users/ruimgoncalves/repos","events_url":"https://api.github.com/users/ruimgoncalves/events{/privacy}","received_events_url":"https://api.github.com/users/ruimgoncalves/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-08T11:18:44Z","updated_at":"2015-08-24T12:04:28Z","closed_at":null,"body":"Hi\r\n\r\nI have an express api that should return data scrapped from various sites depending on the express route.\r\n\r\nBut if multiple requests are executed at the same time or before one of theme is finished errors start being thrown, for example \"Can't set headers after they are sent\".\r\n\r\nI believe this is because context are being passed from one osmosis instance to another. How can I separate entire osmosis instances so I can accomplish this?\r\n\r\nsome code from express\r\n```javascript\r\napp.get '/api/scrape/:site/:ref', (req, res, next) ->\r\n  if req.params.ref.length < 7\r\n    res.status(400).json 'error' : 'Invalid reference'\r\n  else\r\n    siteScrape = new require(\"./src/#{req.params.site}\")\r\n    siteScrape req.params.ref, (err, data)->\r\n      if err\r\n        res.status(400).json\r\n          error : err.toString()\r\n      else\r\n        res.status(200).json data\r\n  return\r\n```\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/rc0x03/node-osmosis/issues/comments/134166797","html_url":"https://github.com/rc0x03/node-osmosis/issues/37#issuecomment-134166797","issue_url":"https://api.github.com/repos/rc0x03/node-osmosis/issues/37","id":134166797,"user":{"login":"andineck","id":697037,"avatar_url":"https://avatars.githubusercontent.com/u/697037?v=3","gravatar_id":"","url":"https://api.github.com/users/andineck","html_url":"https://github.com/andineck","followers_url":"https://api.github.com/users/andineck/followers","following_url":"https://api.github.com/users/andineck/following{/other_user}","gists_url":"https://api.github.com/users/andineck/gists{/gist_id}","starred_url":"https://api.github.com/users/andineck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andineck/subscriptions","organizations_url":"https://api.github.com/users/andineck/orgs","repos_url":"https://api.github.com/users/andineck/repos","events_url":"https://api.github.com/users/andineck/events{/privacy}","received_events_url":"https://api.github.com/users/andineck/received_events","type":"User","site_admin":false},"created_at":"2015-08-24T12:04:28Z","updated_at":"2015-08-24T12:04:28Z","body":"I'm experiencing the same problem, but have no Idea how to fix it... Anyone?"}}