I have a daily launched multi-threaded loading service. I would like to keep tack of the percentage progress of the loader. I was thinking that it would be good to have an update column on a database table that writes the %Progress. However, I have learned that this may not be a good idea as there will there be a large overhead(5k updates per min开发者_JAVA百科ute).
I have been informed that the progress indication is best exposed as a webservice.
Can someone please explain to me how I could implement this? What will the webservice output - XML data such as '21.5% Complete' or otherwise? How would a client appication determine the progress - I assume the webservice should expose some sort of notification event that a client application would implement and listen to update?
we have aysnc webservice, that runs the long running job, we use a secondary method on the webservice to query the database and return the value to the UI, so we could have multiple jobs running and return the value.
Not elegant but it works.
Cheers
Iain
Keep it simple.
Create a web service with 2 methods, updateProgress and getProgress. all the web service has to do store the the Progress in a static variable.
Your loading service just posts the updates and your client polls for progress and whatever rate you consider acceptable.
精彩评论