GlideExecutor

class GlideExecutor : ExecutorService

A prioritized ThreadPoolExecutor for running jobs in Glide.

Types

Link copied to clipboard
class Builder
A builder for GlideExecutors.
Link copied to clipboard
interface UncaughtThrowableStrategy
A strategy for handling unexpected and uncaught Throwables thrown by futures run on the pool.

Functions

Link copied to clipboard
open fun awaitTermination(timeout: Long, unit: TimeUnit): Boolean
Link copied to clipboard
open fun calculateBestThreadCount(): Int
Determines the number of cores available on the device.
Link copied to clipboard
open fun execute(command: Runnable)
Link copied to clipboard
open fun <T> invokeAll(tasks: Collection<out Callable<T>>): List<Future<T>>
open fun <T> invokeAll(    tasks: Collection<out Callable<T>>,     timeout: Long,     unit: TimeUnit): List<Future<T>>
Link copied to clipboard
open fun <T> invokeAny(tasks: Collection<out Callable<T>>): T
open fun <T> invokeAny(    tasks: Collection<out Callable<T>>,     timeout: Long,     unit: TimeUnit): T
Link copied to clipboard
open fun isShutdown(): Boolean
Link copied to clipboard
open fun isTerminated(): Boolean
Link copied to clipboard
open fun newAnimationBuilder(): GlideExecutor.Builder
Returns a new fixed thread pool that defaults to either one or two threads depending on the number of available cores to use when loading frames of animations.
Link copied to clipboard
open fun newAnimationExecutor(): GlideExecutor
Shortcut for calling build on newAnimationBuilder.
open fun newAnimationExecutor(threadCount: Int, uncaughtThrowableStrategy: GlideExecutor.UncaughtThrowableStrategy): GlideExecutor
Link copied to clipboard
open fun newDiskCacheBuilder(): GlideExecutor.Builder
Returns a new Builder with the DEFAULT_DISK_CACHE_EXECUTOR_THREADS threads, DEFAULT_DISK_CACHE_EXECUTOR_NAME name and DEFAULT uncaught throwable strategy.
Link copied to clipboard
open fun newDiskCacheExecutor(): GlideExecutor
Shortcut for calling build on newDiskCacheBuilder.
open fun newDiskCacheExecutor(uncaughtThrowableStrategy: GlideExecutor.UncaughtThrowableStrategy): GlideExecutor
open fun newDiskCacheExecutor(    threadCount: Int,     name: String,     uncaughtThrowableStrategy: GlideExecutor.UncaughtThrowableStrategy): GlideExecutor
Link copied to clipboard
open fun newSourceBuilder(): GlideExecutor.Builder
Returns a new Builder with the default thread count returned from calculateBestThreadCount, the DEFAULT_SOURCE_EXECUTOR_NAME thread name prefix, and the DEFAULT uncaught throwable strategy.
Link copied to clipboard
open fun newSourceExecutor(): GlideExecutor
Shortcut for calling build on newSourceBuilder.
open fun newSourceExecutor(uncaughtThrowableStrategy: GlideExecutor.UncaughtThrowableStrategy): GlideExecutor
open fun newSourceExecutor(    threadCount: Int,     name: String,     uncaughtThrowableStrategy: GlideExecutor.UncaughtThrowableStrategy): GlideExecutor
Link copied to clipboard
open fun newUnlimitedSourceExecutor(): GlideExecutor
Returns a new unlimited thread pool with zero core thread count to make sure no threads are created by default, KEEP_ALIVE_TIME_MS keep alive time, the DEFAULT_SOURCE_UNLIMITED_EXECUTOR_NAME thread name prefix, the DEFAULT uncaught throwable strategy, and the SynchronousQueue since using default unbounded blocking queue, for example, PriorityBlockingQueue effectively won't create more than corePoolSize threads.
Link copied to clipboard
open fun shutdown()
Link copied to clipboard
open fun shutdownNow(): List<Runnable>
Link copied to clipboard
open fun submit(task: Runnable): Future<out Any>
open fun <T> submit(task: Callable<T>): Future<T>
open fun <T> submit(task: Runnable, result: T): Future<T>
Link copied to clipboard
open fun toString(): String