BackgroundWorker Classes?

J

JimTheAverage

I am writing an app that checks web pages for data for clients
automatically. In order to keep the interface from locking up during
intense loops, I was considering using backgroundworker objects.

While using a single backgroundworker object is simple enough, it is
not fast enough. And, looking at the code needed to raise progress
events and completion events, I was wondering if there was a method to
create an array of a single backgroundworker class and have them all
working (retrieving data and sorting it) without having them bump into
one another.

My thought was of a master backgroundworker that would launch and
manage several other background workers. This seems a bit complex
though, and I was wondering if anyone had tried this, has seen
examples of this or had any thoughts that may help me in this pursuit.

Thank you for your help.
 
J

John Bundy

I have something similar, what i did was create a background worker for each
site that loops until it sees that a file is ready and then places the
information into a table. The program is on a timer and every 10 seconds it
checks for a Done value in the table, if it finds it then it retrieves and
saves the data and marks the row as Retrieved and continues to the next. If
there are no more ready it resets the timer and 10 seconds later looks again.
Once it has downloaded all files it stops.
I don't have the backgroundworkers reporting status because it runs in the
background but you could certainly have a table that shows website, last
check time, progress, status etc.
One thing to note is that if you are using a Webbrowser control, you will
want to create a seperate one for each worker and dispose of it when done.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top