Álvaro García
Álvaro García

Reputation: 19356

WCF: async methods, in service or in client?

Well, I am thinking in a WCF service per call, and use async methods for scalability reasons. Then I am thinking in the following, what is better, to have the async methods in the service or in the client?

All the examples that I see is in the contract of the service implement the begin/end methods and then the client consume this methods.

However, I am thinking in other possibility. is it possible to have normal methods in the service and in the client implement the begin/end methods or use CTP and consume the methods of the service asynchroly? If I use this form, would I loose the scalability benefits?

Thanks. Daimroc.

Upvotes: 1

Views: 345

Answers (1)

Sunny
Sunny

Reputation: 6346

I would use the Begin/End pattern in this case - it is an explicit message to the clients that the service is a long-running operation & should expect delays in the processing.

On the other hand, if you have normal methods & if one of the clients did not code the method call properly, all your scalability efforts won't help.

Upvotes: 2

Related Questions