title: Long running tasks in a web server
body: <p>I'm using <code>fasthttp</code> to make an HTTP server in Go. When the user visits a certain route, say <code>/foo</code> I want to start a very long running task (think 10m+), but respond to the request immediately. This long running task should continue running in the background until it exits even if the function returns or the user terminates the connection.</p>
  
  <p>What is the best way to do that in Go?</p>
  
  <p>As far as I can tell Goroutines are probably not the right thing because they're meant for short running async code, or am I wrong about that?</p>