Interface ExecutorRegion
public interface ExecutorRegion
Executor region, managing implementations of
ThreadExecutorRegion (Thread Executor Region).
ManagesUserThreadExecutorRegion,UserVirtualThreadExecutorRegion, andSimpleThreadExecutorRegion. Even if multiple logical servers are started in the same process, thread-related resources will be shared to avoid creating too many threads.UserThreadExecutorRegion- User Thread Executor Region This executor is mainly used to consume action-related business logic, or user-related business logic. The corresponding ThreadExecutor is obtained through userId to execute the business logic, thereby avoiding concurrency issues.UserVirtualThreadExecutorRegion- User Virtual Thread Executor Region This executor is mainly used to consume IO-related business logic (such as DB persistence).SimpleThreadExecutorRegion- Simple Thread Executor Region This executor is similar toUserThreadExecutorRegion. The corresponding ThreadExecutor can be obtained through an index to execute the business logic, thereby avoiding concurrency issues. This executor can be used if the business logic is compute-intensive and you don't want to occupy the thread resources ofUserThreadExecutorRegion.
- Author:
- 渔民小镇
- See Also:
- date:
- 2024-01-11
-
Method Summary
Modifier and TypeMethodDescriptiondefault ThreadExecutorgetSimpleThreadExecutor(long index) Simple thread executorSimple thread executor regiondefault ThreadExecutorgetUserThreadExecutor(long index) User thread executorUser thread executor regiondefault ThreadExecutorgetUserVirtualThreadExecutor(long index) User virtual thread executorUser virtual thread executor region
-
Method Details
-
getUserThreadExecutorRegion
ThreadExecutorRegion getUserThreadExecutorRegion()User thread executor region- Returns:
- User thread executor region
-
getUserVirtualThreadExecutorRegion
ThreadExecutorRegion getUserVirtualThreadExecutorRegion()User virtual thread executor region- Returns:
- User virtual thread executor region
-
getSimpleThreadExecutorRegion
ThreadExecutorRegion getSimpleThreadExecutorRegion()Simple thread executor region- Returns:
- Simple thread executor region
-
getUserThreadExecutor
User thread executor- Parameters:
index- index- Returns:
- User thread executor
-
getUserVirtualThreadExecutor
User virtual thread executor- Parameters:
index- index- Returns:
- User virtual thread executor
-
getSimpleThreadExecutor
Simple thread executor- Parameters:
index- index- Returns:
- Simple thread executor
-