示例#1
0
 public void Start()
 {
     while (Workers.Count < WorkerCount)
     {
         DelegatedWorker <TWorkItem> worker = new DelegatedWorker <TWorkItem>(new DelegatedWorker <TWorkItem> .WorkItemConsumer(WorkItemConsumer),
                                                                              WorkItems);
         Workers.Add(worker);
         worker.Start();
     }
 }
示例#2
0
 public DelegatedWorkerPool(DelegatedWorker <TWorkItem> .WorkItemConsumer workItemConsumer)
 {
     OnConsumeWorkItem = workItemConsumer;
 }