public void Add(IUpdateWorker worker) { if (this.isStarted) { throw new Exception("Unable to add worker to the pool: pool is already started."); } worker.UpdateError += this.OnWorkerUpdateError; this.workers.Add(worker); }
public WorkerInfo(Func <IUpdateable, bool> predicate, IUpdateWorker worker) { this.Predicate = predicate; this.Worker = worker; }
public void Add(Func <IUpdateable, bool> predicate, IUpdateWorker worker) { worker.UpdateError += this.OnWorkerUpdateError; this.workers.Add(new WorkerInfo(predicate, worker)); }