Click here to Skip to main content
14,970,456 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
See more:
I have the following scenario and would like to get some clarification if possible.

I have a javascript function that makes an ajax call to a handler(.ashx) file. The javascript function does not need a return value. The handler will post some data and be done. The handler file makes an ASYNC web request to Bitly, Facebook, and Twitter (not in that order). My idea solution would be for the handler to make an ASYNC call to Bitly (bit.ly), get the result then post to Twitter and Facebook at the same time on different threads as they are independent of each other.

What I am questioning about is the WaitHandle. Should I be using this since the handler is running outside of the user actions or will the callback methods be sufficient? Will the handler file still be listening for the callback if there is no call to hold the current thread until it returns? If I do need to make the thread wait for the callback am I still getting the benefit of making ASYNC web request seeing that the original thread is still waiting or hung up?

I kind of understand how this is suppose to work but can't quite put it all together.

NOTE: The handle is not used to intercept a web request. I am using the handler to process an ajax post. I am calling the handler directly.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900