I've been given a Perl script implementation of a task by a third party product vendor. My job is to translate it into my ASP.NET MVC5 web application.
One component of the perl script is a while loop with this in it:
### Only run this task every second, that's plenty
sleep 1;
Basically they're doing stuff in a while loop at 1 second intervals (pseudo code):
While (condition)
{
-go get an m3u8 playlist file from the web
-parse it line by line
-look for a particular thing in it
-If you find it, break out of this loop and do stuff with it
}
It typically takes between 20-30 tries (20-30 seconds) to find the thing.
Is this the kind of thing asynchronous programming with async and await is geared toward or is this something one just shouldn't have in a web app?
The process would be exposed via ajax call to Web API. If it is feasible, could someone provide some pseudo code on how it might work without blocking the app?