public void Dispose() { this.isDisposed = true; if (this.pool != null) { this.pool.Dispose(); } this.queue = null; this.pool = null; }
public ServiceQueue(Action <T> action = null, Action <T, Exception> onError = null, int?numThreads = null, string name = "Worker", System.Threading.ThreadPriority priority = System.Threading.ThreadPriority.Normal) { this.action = action; this.onError = onError; this.pool = new ServicePool(this.ProcessQueue, numThreads ?? System.Environment.ProcessorCount, name, priority); }