Update progress bar in presentation layer

I have a calculation in business layer which take about 5 minutes in a remote server.  The method to do the calculation is placed in a web service.
The calculation will be started by user in presentation layer with a progress bar showing the progress of the calculation.  What is the proper way to make call back and update the progress bar?
kennon2000Asked:
Who is Participating?
 
ptmcompConnect With a Mentor Commented:
I would not use call backs in this case. Use an async call to invoke the method then use a timer and call a remote method "GetProgress". For the completion of the async call you can either use polling or a completion event.
0
 
kennon2000Author Commented:
Why not use call back?
I understand your approach, but I am not sophicated in the overall skill.  Is there any code example/code that I can learn the skills?
Thanks.
0
 
ptmcompCommented:
Callbacks from a remoteserver are quiet akward and it will not work if you have a firewall between or if you are using NAT.
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
ptmcompCommented:
And how do you want to decide when you need to update the progress bar? You should do this by a timer and not after each step else if you have many little steps your network will be busy and the progress bar flickering.
0
 
kennon2000Author Commented:
I see.
Can I just update a property( say int Progress) within the remote method TimeConsumingMethod() in the same web service class.  And simply get Progress in the timer tick()?
 
0
 
ptmcompCommented:
If you have one distinct client and you synchronize (simple a lock will do) the access to the progress property, yes. If you have several sessions you need to reference your remote object to get its state.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.