We have a web application in which the user enters the input to some computational problem, sends it to a server, and the server calculates and returns the result. For some inputs, the calculation takes a long time, so the server returns a page saying "I am working on it", and continues working on it in a background thread. When the solution is ready, the thread sends an email to the user.

This worked well on a Linux server, but when we moved it to Heroku, it stopped working - we found out that, when the server returns a reply to the user, Heroku stops all threads, including the computation thread.

What is the correct way to implement this scheme in Heroku?

  • If they kill off the process, it sounds like the service just isn't designed for this usage pattern. – Stephen Ostermiller Oct 29 at 10:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.