Package com.luna.common.worker
Class SyncTaskWorker<T>
java.lang.Object
com.luna.common.worker.SyncTaskWorker<T>
- All Implemented Interfaces:
Runnable
任务worker
- Version:
- 1.0
-
Field Summary
-
Constructor Summary
ConstructorDescriptionSyncTaskWorker
(ExecutorService threadPool) SyncTaskWorker
(LinkedBlockingQueue<T> taskQueue, ExecutorService threadPool, com.google.common.util.concurrent.RateLimiter rateLimiter) -
Method Summary
Modifier and TypeMethodDescriptionvoid
getTask()
abstract void
handleTask
(T task) abstract void
init()
initialize the task queue sizevoid
run()
-
Field Details
-
taskQueue
任务队列 -
threadPool
任务线程
-
-
Constructor Details
-
SyncTaskWorker
public SyncTaskWorker(LinkedBlockingQueue<T> taskQueue, ExecutorService threadPool, com.google.common.util.concurrent.RateLimiter rateLimiter) -
SyncTaskWorker
-
-
Method Details