Non-Web Async and Await Questions
-
I'm trying to use a progress bar in a .Net 4.5 application while calling a method that doesn't return for 5-7 seconds. This is a simple application, but the examples I've seen are either based on file operations or web operations. Since mine is neither I'm unclear as to: 1) What type of async method to use? 2) For the await method what type of .NET method do I use (e.g., .DownloadStringTaskAsync)? I'm trying to use Furytrader post 'Simple .Net progress bar using async/await', 2/18/2014, but I'm struggling. Example code is a lot to ask for but mod's to Furytrader's post might be easier.
-
I'm trying to use a progress bar in a .Net 4.5 application while calling a method that doesn't return for 5-7 seconds. This is a simple application, but the examples I've seen are either based on file operations or web operations. Since mine is neither I'm unclear as to: 1) What type of async method to use? 2) For the await method what type of .NET method do I use (e.g., .DownloadStringTaskAsync)? I'm trying to use Furytrader post 'Simple .Net progress bar using async/await', 2/18/2014, but I'm struggling. Example code is a lot to ask for but mod's to Furytrader's post might be easier.
With a bit more investigation, it was apparent that the time consuming task in this example, retrieving a string from a website, was effectively driving the frequency that the progress bar was updated -- retrieve a string then update the progress bar. My problem is that the task I'm calling does not return for several seconds and it is during this time that I want to be updating the progress bar since the task is a blocking task. How do I call such a task and also be updating the progress bar?
-
I'm trying to use a progress bar in a .Net 4.5 application while calling a method that doesn't return for 5-7 seconds. This is a simple application, but the examples I've seen are either based on file operations or web operations. Since mine is neither I'm unclear as to: 1) What type of async method to use? 2) For the await method what type of .NET method do I use (e.g., .DownloadStringTaskAsync)? I'm trying to use Furytrader post 'Simple .Net progress bar using async/await', 2/18/2014, but I'm struggling. Example code is a lot to ask for but mod's to Furytrader's post might be easier.