1

I have a system with about 10 WCF services.

The services communicate between themselves using a ChannelFactory.

The ChannelFactory is used behind an interceptor.

Here's a sample of how the code looks:

var service = ServiceCreator.CreateService<IService1>(); // dynamic proxy
service.DoSomething(); // behind the scenes the call is intercepted and the WCF channel factory is called

My problem is that my interfaces have sync methods and I have a bottle neck on waiting for these sync service calls to finish - This blocks my threads and causes performance issues.

How does the svcutil create Task based methods for services? I would like to somehow do the same thing inside an interceptor and scale my application better.

Amir Popovich
  • 29,350
  • 9
  • 53
  • 99
  • Wouldn't `Task` and async await work? – CodingYoshi Jan 01 '17 at 19:29
  • I have only sync methods implemented in my service. If I would use the svcutil and create a service reference, he would create Task methods as well somehow. I guess it doesn't wrap the sync call with Task.Run or something and therefore, I would like to know how he creates real async methods around sync methods and maybe use that strength to solve my case. – Amir Popovich Jan 01 '17 at 19:33
  • Why don't you use the utility to create the code for you and then use that from your interceptor? – CodingYoshi Jan 01 '17 at 19:43
  • Since I'm using interfaces from my service. If I would use the service reference, I wouldn't need the interception. The whole idea here is to create an additional layer of abstraction so in the future it will be easy to convert the services to rest\queue based services. That's the strength the interceptor gives us. – Amir Popovich Jan 01 '17 at 19:46

0 Answers0