Class GlideExecutor.Builder
java.lang.Object
com.bumptech.glide.load.engine.executor.GlideExecutor.Builder
- Enclosing class:
- GlideExecutor
A builder for
GlideExecutors.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longPrevents core and non-core threads from timing out ever if provided tosetThreadTimeoutMillis(long). -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newGlideExecutorwith any previously specified options.Sets the prefix to use for each thread name created by anyGlideExecutors built by thisBuilder.setThreadCount(int threadCount) Sets the maximum number of threads to use.setThreadFactory(ThreadFactory threadFactory) Deprecated.This is an experimental method that may be removed without warning in a future version.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.Sets theGlideExecutor.UncaughtThrowableStrategyto use for unexpected exceptions thrown by tasks onGlideExecutors built by thisBuilder.
-
Field Details
-
NO_THREAD_TIMEOUT
public static final long NO_THREAD_TIMEOUTPrevents core and non-core threads from timing out ever if provided tosetThreadTimeoutMillis(long).- See Also:
-
-
Method Details
-
setThreadTimeoutMillis
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
Sets the maximum number of threads to use. -
setThreadFactory
Deprecated.This is an experimental method that may be removed without warning in a future version.Sets theThreadFactoryresponsible for creating threads and setting their priority.Usage of this method may override other options on this builder. No guarantees are provided with regards to the behavior of this method or how it interacts with other methods on the builder. Use at your own risk.
-
setUncaughtThrowableStrategy
public GlideExecutor.Builder setUncaughtThrowableStrategy(@NonNull GlideExecutor.UncaughtThrowableStrategy strategy) Sets theGlideExecutor.UncaughtThrowableStrategyto use for unexpected exceptions thrown by tasks onGlideExecutors built by thisBuilder. -
setName
Sets the prefix to use for each thread name created by anyGlideExecutors built by thisBuilder. -
build
Builds a newGlideExecutorwith any previously specified options.
-