title: PHP - Long Running Background Task
body: <p>I am currently trying to generate an epub on demenad from content that is available to me.
  Unfortunately, when there is alot of content for the epub, it takes a while (10 mins in some cases) for the http request to complete - which is not ideal</p>
  
  <p>I want to follow an approach similar to that of Safari 
  - Generate an epub and email the user when the document is available</p>
  
  <p>My question is - what is the best way for running a background task/thread in PHP that could take a long time to complete</p>