1 package org.testng.internal.thread.graph;
2 
3 import java.util.List;
4 import java.util.Set;
5 
6 
7 /**
8  * A factory that creates workers used by {@code GraphThreadPoolExecutor}
9  * @author nullin
10  *
11  * @param <T>
12  */
13 public interface IThreadWorkerFactory<T> {
14 
15   /**
16    * Creates {@code IWorker} for specified set of tasks. It is not necessary that
17    * number of workers returned be same as number of tasks entered.
18    *
19    * @param freeNodes tasks that need to be executed
20    * @return list of workers
21    */
createWorkers(List<T> freeNodes)22   List<IWorker<T>> createWorkers(List<T> freeNodes);
23 }
24