public class ThreadPoolsFactory extends Object
| Constructor and Description |
|---|
ThreadPoolsFactory() |
| Modifier and Type | Method and Description |
|---|---|
protected static ThreadPoolExecutor |
getExecutor(String groupId) |
static void |
registerThreadPool(String groupId,
ThreadPoolExecutor executor)
You can specify the ThreadPoolExecutor yourself here
|
static Future<?> |
runClosureInThread(String groupId,
Closure done)
Run closure with OK status in thread pool.
|
static Future<?> |
runClosureInThread(String groupId,
Closure done,
Status status)
Run closure with status in thread pool.
|
static Future<?> |
runInThread(String groupId,
Runnable runnable)
Run a task in thread pool,returns the future object.
|
public static void registerThreadPool(String groupId, ThreadPoolExecutor executor)
groupId - Raft-Groupexecutor - To specify ThreadPoolExecutor@OnlyForTest protected static ThreadPoolExecutor getExecutor(String groupId)
public static Future<?> runInThread(String groupId, Runnable runnable)
public static Future<?> runClosureInThread(String groupId, Closure done, Status status)
Copyright © 2024. All rights reserved.