0

I have an application form with 3 pages/steps. On the 2nd step, there are calls to potentially up to 2 external third party APIs, with the results of these calls stored in our local DB, before moving to step 3. I don't really care about the response from these APIs until the end of Step 3, where I then check the DB for the results to determine what should happen after step 3 is processed.

Currently, the API calls block the user from moving onto step 3. In the event that the request takes a while it leads to an unresponsive application and the possibility that the user will get fed up waiting. I'd like to make the application process more responsive by making the web calls asynchronous so that the user can begin completing step 3, by which time the results of step 2 should have been returned.

I can see that ASP.NET 4.5 has async and await methods which I think will probably help, but wondered what my options are in the meantime?

1 Answer 1

1

If you dont care about return values from your async methods, then you can just delegate your blocking calls to a threadpool, and continue with no further changes to your code.

Have a look at System.Threading.ThreadPool.QueueUserWorkItem http://msdn.microsoft.com/en-us/library/4yd16hza.aspx

Sign up to request clarification or add additional context in comments.

1 Comment

also, await and async would not help to solve your current problem. Their strength lies in syntactic sugar for callback handling.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.