I am in a situation where I have to run multiple async tasks (like sending emails, processing files etc.) after a user makes a request to the server. They are not heavy-weight tasks by any means but would still make the response time slow if I don't run them in the background. Currently, I have them set up as following: https://1921681254.mx/
}
The response is returned quickly this way and the tasks are processed but I'm not sure if this is the correct way of doing it. I would appreciate if anyone could critique my code and provide a better (and preferably equally simple) solution.