Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Progress notification in WCF for long running processes - How?

I have to design and implement a way to deal with long running processes in a client/server application. A typical long running process would/could take 2-3 minutes. I also need to report progress to the UI in the meantime and keep the UI responsive.

Having these in my mind I though of a few solutions:

  • One async request to start the process which starts the server-side process and returns an assigned LRPID (Long Running Process ID) then poll periodically from the client using that LRPID. (Pro: simple to deploy, no firewall messing around Con: Unelegant, resource consuming etc.)

  • Use a duplex binding (such as NetTcpBinding) and initiate callbacks from the server as progress is being made (Pro: Elegant, efficient, Con: Deployment nightmare)

  • [Your suggestion???]

What would be your take on this?

like image 792
Andrei Rînea Avatar asked Jan 13 '11 17:01

Andrei Rînea


2 Answers

Here is a post by Dan Wahlin about how to create a WCF Progress Indicator for a Silverlight Application. This should be of some help.

like image 88
Matt Klepeis Avatar answered Nov 11 '22 07:11

Matt Klepeis


If you do not want to have to worry about the client's firewall, etc... I would probably go with your first solution and use a BackGroundWorker to make the call in order to keep from blocking the UI thread. I did this recently for an app where a request to generate a report is put on a queue and is retrieved once it is done. It seems to work well.

like image 36
Daniel Auger Avatar answered Nov 11 '22 07:11

Daniel Auger