1

I have a WCF service (hosted in IIS 6) with two services, FileMonitorService ans JobService. In one of FileMonitorService's methods I want to call a method in JobService through WCF. This method in JobService is executed asynchronously (fire and forget).

I suppose it'd be easy enough use a Thread Pool and signal when they are all done.. I'd rather use WCF though (this is a personal project, so I'm just trying out new things).

edit: I came across these two posts, but they addressed WCF services across different servers.
Calling a WCF service from another WCF service
calling a WCF service object method in another WCF service

edit 2: Clarification on question:

Less a question I suppose than more of a request for thoughts on the approach.

Community
  • 1
  • 1
Bryce Fischer
  • 5,336
  • 9
  • 30
  • 36
  • Is there a reason for not wanting to call the method directly asynchronously? – Alfred Myers Sep 16 '10 at 13:48
  • Sorry it wasn't clear. I'm just soliciting thoughts on the approach. I could call the method directly, was thinking I could take advantage of WCF's threading. Conceptually, what I'm trying to do is fire a service (from within the service) that is "fire and forget". As I write this, it occurs to me that a more appropriate solution may be to fire a WF process, since in effect, that's what I'm doing... – Bryce Fischer Sep 16 '10 at 14:03

1 Answers1

1

Doing it through WCF only adds overhead so you should call the method in JobServices directly unless you have a compelling reason to not to do so. Given the limited amount of context, I would stick with the ThreadPool if I were you.

Alfred Myers
  • 6,384
  • 1
  • 40
  • 68
  • I agree I think. As I mentioned in my comment above, I realized that instead of a service, what the initial WCF service is basically doing is kicking off a workflow.. So I think WF may be the best solution in this case. – Bryce Fischer Sep 16 '10 at 14:10
  • Nope, went with your suggestion Alfred and the JobServices uses ThreadPool directly. – Bryce Fischer Oct 01 '10 at 18:54