Why wait for asynchronous web service calls

I was looking at the MSDN documentation on WebServices. Here and here , both of these links talk about calling a web service and waiting for a response, which is also a general trend that I saw during an asynchronous implementation.

I do not understand why we need to wait for the service call to return? And, if we wait, why not make a synchronous call. What is the difference between an asynchronous call followed by a wait and a synchronous call?

+3
source share
5 answers

, , - . :

WaitHandle . WaitHandle :

  • - XML (WaitHandle.WaitOne),
  • - XML (WaitHandle.WaitAny),
  • - XML (WaitHandle.WaitAll)

.

, WaitOne WaitAny -, , - , .

+4
+3

. ( ), -, , - .

, , , -. - , , , -, , .

, -, .

, -, -. ( ), IIS , , -, , " IO", ASP.NET, -.

+1

, , , . , , .

, , , . , , , .

+1

, , , , . CancellationToken .NET 4.0 ( pre-.NET4) , , .

0

Source: https://habr.com/ru/post/1720143/


All Articles