/// <summary> /// Initializes a new instance of the <see cref="WorkItemDispatcher<T>"/> class. /// </summary> /// <param name="width">Number of IO threads to start in parallel.</param> /// <param name="processor">Delegate which is called in width threads to process work.</param> /// <param name="name">Instance Name of the Dispatcher.</param> /// <param name="work">Input blocking queue from which work is fetched for the worker threads.</param> public WorkItemDispatcher(int width, Action <T> processor, string name, BlockingQueue <T> work) : this(width, processor, name, work, WorkItemOptions.Default) { }
/// <summary> /// Create n-threads from the IO thread pool and process the data in the processor delegate which is fetched /// from the work queue. /// </summary> /// <param name="width">Number of IO threads to start in parallel.</param> /// <param name="processor">Delegate which is called in width threads to process work.</param> /// <param name="work">Input queue which contains the work items for all threads.</param> /// <param name="options">Exception handling options.</param> public WorkItemDispatcher(int width, Action <T> processor, BlockingQueue <T> work, WorkItemOptions options) : this(new WorkItemDispatcherData <T>() { Width = width, Processor = processor, InputData = work, Options = options }) { }
public void Dispose() { mySearcher = null; myCurrentFile = null; myResultQueue = null; }