Class GlideExecutor.Builder
- java.lang.Object
-
- com.bumptech.glide.load.engine.executor.GlideExecutor.Builder
-
- Enclosing class:
- GlideExecutor
public static final class GlideExecutor.Builder extends java.lang.ObjectA builder forGlideExecutors.
-
-
Field Summary
Fields Modifier and Type Field Description static longNO_THREAD_TIMEOUTPrevents core and non-core threads from timing out ever if provided tosetThreadTimeoutMillis(long).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GlideExecutorbuild()Builds a newGlideExecutorwith any previously specified options.GlideExecutor.BuildersetName(java.lang.String name)Sets the prefix to use for each thread name created by anyGlideExecutors built by thisBuilder.GlideExecutor.BuildersetThreadCount(int threadCount)Sets the maximum number of threads to use.GlideExecutor.BuildersetThreadTimeoutMillis(long threadTimeoutMillis)Allows both core and non-core threads in the executor to be terminated if no tasks arrive for at least the given timeout milliseconds.GlideExecutor.BuildersetUncaughtThrowableStrategy(GlideExecutor.UncaughtThrowableStrategy strategy)Sets theGlideExecutor.UncaughtThrowableStrategyto use for unexpected exceptions thrown by tasks onGlideExecutors built by thisBuilder.
-
-
-
Field Detail
-
NO_THREAD_TIMEOUT
public static final long NO_THREAD_TIMEOUT
Prevents core and non-core threads from timing out ever if provided tosetThreadTimeoutMillis(long).- See Also:
- Constant Field Values
-
-
Method Detail
-
setThreadTimeoutMillis
public GlideExecutor.Builder setThreadTimeoutMillis(long threadTimeoutMillis)
Allows both core and non-core threads in the executor to be terminated if no tasks arrive for at least the given timeout milliseconds.Use
NO_THREAD_TIMEOUTto remove a previously set timeout.
-
setThreadCount
public GlideExecutor.Builder setThreadCount(@IntRange(from=1L) int threadCount)
Sets the maximum number of threads to use.
-
setUncaughtThrowableStrategy
public GlideExecutor.Builder setUncaughtThrowableStrategy(@NonNull GlideExecutor.UncaughtThrowableStrategy strategy)
Sets theGlideExecutor.UncaughtThrowableStrategyto use for unexpected exceptions thrown by tasks onGlideExecutors built by thisBuilder.
-
setName
public GlideExecutor.Builder setName(java.lang.String name)
Sets the prefix to use for each thread name created by anyGlideExecutors built by thisBuilder.
-
build
public GlideExecutor build()
Builds a newGlideExecutorwith any previously specified options.
-
-