NickD
NickD

Reputation: 2646

AsyncAwait a WCF Call

I have a MVC4 Application which waits for a third party subsystem. Each request takes 2 to 5 Seconds. The communication is done via WCF and i use NET 4.5.

Currently i wait synchronous to the answer and show then results. All sql queries after the result is received cannot be moved in between the async and await, as they are depended on the result.

Does it make sense anyway to apply the AsyncAwait pattern?

Does it reduce the amount of threads inside the IIS?

Sample:

client2 = new ServiceReference2.Service1Client();
string res = await client2.GetHello2Async();

Upvotes: 1

Views: 239

Answers (1)

svick
svick

Reputation: 244757

Yes, switching to async-await is going to decrease the number of ThreadPool threads used by your code. That's the primary reason for using async-await in server-side applications.

Upvotes: 1

Related Questions