Implementing the Worker Class

Before continuing, we need to make adjustments external to this class.

Adding a FileWorker Collection

We need to add a collection to the service that can hold the number of worker class instances we plan to create. As shown in Example 4-16, we will create five worker threads. This number is simply for example purposes and could easily change on a dynamic basis, which I will demonstrate shortly.

Example 4-16. Declaration for the worker collection in the Tutorials service class.

Private m_WorkerThreads As New Collection

Adding New File Type and Input Locations

With this implementation, we need to be able to supply five specific file locations or a combination of file locations and file types. These should be implemented as ...

Get Programming Windows® Services with Microsoft® Visual Basic® 2008 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.