We have 10 BackgroundWorkers in a project.
We have DoWork events on a couple and we also we want them to "sleep" for a specified period of time before
actually running again.
We do this at the end of the DoWork in one of the backgroundworkers named bwPatientRequests:
System.Threading.Thread.Sleep(INTERVAL_PatientRequests) 'INTERVAL_PatientRequests = 180000
Doesn't this mean this thing should sleep for 3 min before it runs again.
Why is this one and another one running every minute?
We have one other one whose interval is set to one minute and in each of the ones we want to sleep we have a RunWorkerCompleted event and call Application.DoEvents() in each of them.
Any idea how we can make them have different intervals and sleep accordingly?
bwVisitRequests - should sleep 3 minutes (INTERVAL_VisitRequsts = 180000)
bwPatientRequests - should sleep 3 minutes (INTERVAL_PatientRequests = 180000)
bwProcessMessages - should sleep 1 minute. (INTERVAL_ProcessMessages = 10000)
bwProcessMessages processes the messages retrieved by the other two workers at their intevals.