3 ms·
Task queues also allow for interesting web application architecture when combined with technologies that enable the server to push events to the client (think W
by deet 15y ago
Task queues also allow for interesting web application architecture when combined with technologies that enable the server to push events to the client (think WebSockets, Socket.IO, etc).
The potential is far greater than simple tasks like sending an email, fetching external data, etc. If the server has the ability to push updates, you can start to use task queues in core user interactions. This is possible when workers can notify clients when their task is complete.
For example, you can have clients submit HTTP requests to the web server, the web server dispatch jobs to the task queue, worker processes (potentially in a different language than your web server!) retrieve those jobs, and then the workers directly notify clients when the job is complete. Combined with client-side logic, the result can be a good user experience, even when the server is performing complex tasks.
For example, I'm using this strategy to write web-based statistics software (think web-based Stata or SPSS). Without this type of asynchronous architecture, it simply wouldn't be possible to provide a good user experience because the core things the user wants to do are computationally intensive.