Java Code Examples for com.nostra13.universalimageloader.core.assist.QueueProcessingType#LIFO

The following examples show how to use com.nostra13.universalimageloader.core.assist.QueueProcessingType#LIFO . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DefaultConfigurationFactory.java    From candybar with Apache License 2.0 5 votes vote down vote up
/**
 * Creates default implementation of task executor
 */
public static Executor createExecutor(int threadPoolSize, int threadPriority,
                                      QueueProcessingType tasksProcessingType) {
    boolean lifo = tasksProcessingType == QueueProcessingType.LIFO;
    BlockingQueue<Runnable> taskQueue =
            lifo ? new LIFOLinkedBlockingDeque<Runnable>() : new LinkedBlockingQueue<Runnable>();
    return new ThreadPoolExecutor(threadPoolSize, threadPoolSize, 0L, TimeUnit.MILLISECONDS, taskQueue,
            createThreadFactory(threadPriority, "uil-pool-"));
}
 
Example 2
Source File: DefaultConfigurationFactory.java    From mobile-manager-tool with MIT License 5 votes vote down vote up
/** Creates default implementation of task executor */
public static Executor createExecutor(int threadPoolSize, int threadPriority,
		QueueProcessingType tasksProcessingType) {
	boolean lifo = tasksProcessingType == QueueProcessingType.LIFO;
	BlockingQueue<Runnable> taskQueue =
			lifo ? new LIFOLinkedBlockingDeque<Runnable>() : new LinkedBlockingQueue<Runnable>();
	return new ThreadPoolExecutor(threadPoolSize, threadPoolSize, 0L, TimeUnit.MILLISECONDS, taskQueue,
			createThreadFactory(threadPriority, "uil-pool-"));
}
 
Example 3
Source File: DefaultConfigurationFactory.java    From BigApp_WordPress_Android with Apache License 2.0 5 votes vote down vote up
/** Creates default implementation of task executor */
public static Executor createExecutor(int threadPoolSize, int threadPriority,
		QueueProcessingType tasksProcessingType) {
	boolean lifo = tasksProcessingType == QueueProcessingType.LIFO;
	BlockingQueue<Runnable> taskQueue =
			lifo ? new LIFOLinkedBlockingDeque<Runnable>() : new LinkedBlockingQueue<Runnable>();
	return new ThreadPoolExecutor(threadPoolSize, threadPoolSize, 0L, TimeUnit.MILLISECONDS, taskQueue,
			createThreadFactory(threadPriority, "uil-pool-"));
}
 
Example 4
Source File: DefaultConfigurationFactory.java    From WliveTV with Apache License 2.0 5 votes vote down vote up
/** Creates default implementation of task executor */
public static Executor createExecutor(int threadPoolSize, int threadPriority,
		QueueProcessingType tasksProcessingType) {
	boolean lifo = tasksProcessingType == QueueProcessingType.LIFO;
	BlockingQueue<Runnable> taskQueue =
			lifo ? new LIFOLinkedBlockingDeque<Runnable>() : new LinkedBlockingQueue<Runnable>();
	return new ThreadPoolExecutor(threadPoolSize, threadPoolSize, 0L, TimeUnit.MILLISECONDS, taskQueue,
			createThreadFactory(threadPriority, "uil-pool-"));
}
 
Example 5
Source File: DefaultConfigurationFactory.java    From Android-Universal-Image-Loader-Modify with Apache License 2.0 5 votes vote down vote up
/**
 * Creates default implementation of task executor
 * 任务执行者的构造方法,当前用于实现默认的task executor
 */
public static Executor createExecutor(int threadPoolSize, int threadPriority,
		QueueProcessingType tasksProcessingType) {
	//初始化队列算法类型 默认为LIFO
	boolean lifo = tasksProcessingType == QueueProcessingType.LIFO;
	//初始化队列 根据不同的算法类型,创建不同的队列
	BlockingQueue<Runnable> taskQueue =
			lifo ? new LIFOLinkedBlockingDeque<Runnable>() : new LinkedBlockingQueue<Runnable>();
	return new ThreadPoolExecutor(threadPoolSize, threadPoolSize, 0L, TimeUnit.MILLISECONDS, taskQueue,
			createThreadFactory(threadPriority, "uil-pool-"));
}
 
Example 6
Source File: DefaultConfigurationFactory.java    From android-open-project-demo with Apache License 2.0 5 votes vote down vote up
/** Creates default implementation of task executor */
public static Executor createExecutor(int threadPoolSize, int threadPriority,
		QueueProcessingType tasksProcessingType) {
	boolean lifo = tasksProcessingType == QueueProcessingType.LIFO;
	BlockingQueue<Runnable> taskQueue =
			lifo ? new LIFOLinkedBlockingDeque<Runnable>() : new LinkedBlockingQueue<Runnable>();
	return new ThreadPoolExecutor(threadPoolSize, threadPoolSize, 0L, TimeUnit.MILLISECONDS, taskQueue,
			createThreadFactory(threadPriority, "uil-pool-"));
}
 
Example 7
Source File: DefaultConfigurationFactory.java    From letv with Apache License 2.0 4 votes vote down vote up
public static Executor createExecutor(int threadPoolSize, int threadPriority, QueueProcessingType tasksProcessingType) {
    return new ThreadPoolExecutor(threadPoolSize, threadPoolSize, 0, TimeUnit.MILLISECONDS, tasksProcessingType == QueueProcessingType.LIFO ? new LIFOLinkedBlockingDeque() : new LinkedBlockingQueue(), createThreadFactory(threadPriority, "uil-pool-"));
}