How to handle background jobs with elixir/phoenix

If you do it like this (without a job processing library, which is fine) keep the things in mind that are described in this article from Chris McCord https://dockyard.com/blog/2016/05/02/phoenix-tips-and-tricks under the title “Avoid Task.async if you don’t plan to task.await”. The summary is that if you want to use Task.async to process your CSV file, hook it into it’s own Task.Supervisor so that it is isolated from the controller.

4 Likes