public class FileDownloadExecutors extends Object
All thread pools in FileDownloader will comply with:
The default thread count is 0, and the maximum pool size is nThreads; When there are less
than nThreads threads running, a new thread is created to handle the request, but when it
turn to idle and the interval time of waiting for new task more than DEFAULT_IDLE_SECOND
second, the thread will be terminate to reduce the cost of resources.
| Constructor and Description |
|---|
FileDownloadExecutors() |
| Modifier and Type | Method and Description |
|---|---|
static ThreadPoolExecutor |
newDefaultThreadPool(int nThreads,
LinkedBlockingQueue<Runnable> queue,
String prefix) |
static ThreadPoolExecutor |
newDefaultThreadPool(int nThreads,
String prefix) |
static ThreadPoolExecutor |
newFixedThreadPool(String prefix) |
public static ThreadPoolExecutor newFixedThreadPool(String prefix)
public static ThreadPoolExecutor newDefaultThreadPool(int nThreads, String prefix)
public static ThreadPoolExecutor newDefaultThreadPool(int nThreads, LinkedBlockingQueue<Runnable> queue, String prefix)