I want to call a web service from another web service in a non-blocking way. I’ve implemented this by using BackgroundWorker. But, I’m not sure whether this is the best way to do.
Scenario:
I call a web service Service_A which performs certain task & has to inform another web service Service_B about the changes made. I call the Service_B’s one-way function NotifyUpdates for handling the updates. Service_A doesn’t waits for Service_B’s response & continues with its task. The response from the Service_B is logged in the background.
My question is, what is the best way to do it?
Thanks.
BackgroundWorker is purposed for UI use, and I don’t think it’s the best way to use it here.
If you are using .Net 4 better to use Task
If not,use ThreadPool.QueueUserWorkItem or Thread
Hope this helps