title: Background jobs that run on every request on Heroku and node.js
body: <p>I have an app that needs to run a very long process (takes 30-60 seconds for each request). After the processing, the result is then returned to the request as a response. This works fine locally, but it crashes my Heroku instance.</p>
  
  <p>What I'd like to happen instead is:</p>
  
  <ul>
  <li>User comes on site, request sent to backend</li>
  <li>Backend returns immediately, and kicks off another process/task/job that does the processing</li>
  <li>When the processing ends, the response is returned to the correct user.</li>
  </ul>
  
  <p>I am not sure what all I need for this. Based on an hour-long research, it seems like I can use Redis as a queue and a worker can poll it every x minutes. But what I can't understand is how to figure out which request to send the response to after processing ends.</p>
  
  <p>Is there a sample Express/node.js for this? Any pointers are helpful.</p>