In a web application there can be many time-consuming processes which, if we execute them synchronously within a controller, will block the user from receiving a response (which they’ll experience as painfully slow load times) and in today’s world, this is completely and utterly unacceptable!
Here are some examples:
-
Preparing a download, say
zipfile, where file compression happens on-the-fly (e.g. Google Docs) -
POSTing a request to an external API (e.g. sending a message to Slack)