Interface ThreadExecutorRegion
public interface ThreadExecutorRegion
Interface for a region of thread executors that distributes tasks by index.
Implementations map an arbitrary long index to one of a fixed set of
ThreadExecutor instances, allowing deterministic task-to-thread assignment.
- Author:
- 渔民小镇
- date:
- 2023-12-01
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidGet the Executor by index to run the task.getThreadExecutor(long index) Get the Executor based on the index.
-
Method Details
-
getThreadExecutor
Get the Executor based on the index.- Parameters:
index- the index used to select an executor from the region- Returns:
- the
ThreadExecutormapped to the given index
-
execute
Get the Executor by index to run the task.- Parameters:
runnable- the task to executeindex- the index used to select an executor
-