Allow custom ExecutorService to be supplied to the Loader

This commit is contained in:
Colin Kho 2024-07-30 13:20:30 -07:00
parent 3f49f5c157
commit 68e65ec884

View File

@ -214,8 +214,14 @@ public final class Loader implements LoaderErrorThrower {
* component using the loader. * component using the loader.
*/ */
public Loader(String threadNameSuffix) { public Loader(String threadNameSuffix) {
this.downloadExecutorService = this(Util.newSingleThreadExecutor(THREAD_NAME_PREFIX + threadNameSuffix));
Util.newSingleThreadExecutor(THREAD_NAME_PREFIX + threadNameSuffix); }
/**
* @param downloadExecutorService An {@link ExecutorService} for supplying the loader's thread.
*/
public Loader(ExecutorService downloadExecutorService) {
this.downloadExecutorService = downloadExecutorService;
} }
/** /**