Interface ExecutorRegion


public interface ExecutorRegion
Executor region, managing implementations of ThreadExecutorRegion (Thread Executor Region).
Manages UserThreadExecutorRegion, UserVirtualThreadExecutorRegion, and SimpleThreadExecutorRegion.
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 to UserThreadExecutorRegion.
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 of UserThreadExecutorRegion.
Author:
渔民小镇
See Also:
  • User Thread Executor Region
  • User Virtual Thread Executor Region
  • Simple Thread Executor Region
date:
2024-01-11
  • 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

      default ThreadExecutor getUserThreadExecutor(long index)
      User thread executor
      Parameters:
      index - index
      Returns:
      User thread executor
    • getUserVirtualThreadExecutor

      default ThreadExecutor getUserVirtualThreadExecutor(long index)
      User virtual thread executor
      Parameters:
      index - index
      Returns:
      User virtual thread executor
    • getSimpleThreadExecutor

      default ThreadExecutor getSimpleThreadExecutor(long index)
      Simple thread executor
      Parameters:
      index - index
      Returns:
      Simple thread executor