tags:

views:

344

answers:

4

Hi,

I need a VB.NET Forms application that processes a queue. It basically needs to ping a web service every 30 seconds and then load documents into a document management system, if there are any to load.

How would I implement this? Using a loop? Do I need to look into threads?

Thanks

A: 

How did you define the queue. You can do it with mutlithreading (that is create a threadpool instance) and let the threadpool pop the objects in the queue.

However if you have something like file searching in the queue objects then obvsiouly you'd want the first que objec to finish before starting the second (that is, if they use the same file).

masfenix
+1  A: 

If you are already using web services then you may want to stay with the thread-like behavior of services with less complications.

Otherwise, just use a Timer object, or if possible, a FileSystemWatcher for your triggers.

Jeff.Crossett
A: 

use System.Windows.Forms.Timer, set to 30000 msec interval (30 seconds)

use System.Collections.Generic queue, initialized using Enqueue

have the timer-elapsed method fetch the next element from the queue (presumably a web service url) using Dequeue and process it

crude, but effective

Steven A. Lowe
A: 

get it here http://www.codedefiner.com/vbnet/vbnetQueue.aspx