

Ask HN: How do you handle possibly long running tasks in your web app? - WorldWideWayne

This is one issue that I have encountered over and over in my career and every time it comes up, I have to go research what the best options are. Today I&#x27;m asking for help instead. Here is my problem:<p>I am building a web application where the user could kick off a task that could take seconds, minutes or hours. I don&#x27;t define the tasks, the users do, so I won&#x27;t know until they run it a few times. When a task is done, they can see a preview of the results and&#x2F;or choose to download the entire result-set.<p>I always use polling for this because it&#x27;s simple. By &quot;polling&quot;, I do not mean &quot;long polling&quot;&#x2F;comet. Basically, once my javascript knows that a task is running, it starts setting timeouts to ask the server if any pending tasks have notifications.<p>Websockets seem to be overkill for this because it&#x27;s not an IM application or a game. So, what I want to know is - are there any better ways of handling this yet? Anything that integrates well with Angular (instead of coding up my own algorithm described above)?<p>Thanks!
======
WorldWideWayne
Funny, it looks like while I was writing my post someone else posted an
article "Do you really need a WebSocket?" \-
[https://news.ycombinator.com/item?id=8015399](https://news.ycombinator.com/item?id=8015399)

