Interface ExecutorSelector

All Known Implementing Classes:
DefaultExecutorSelector

public interface ExecutorSelector
Interface that allows customizing the selection of the ExecutorService to run an operation on.
Since:
1.0
  • Method Details

    • select

      Optional<ExecutorService> select(@Nullable io.micronaut.inject.MethodReference<?,?> method, ThreadSelection threadSelection)
      Select an ExecutorService for the given MethodReference.
      Parameters:
      method - The MethodReference
      threadSelection - The thread selection mode
      Returns:
      An optional ExecutorService. If an ExecutorService cannot be established Optional.empty() is returned
    • select

      Obtain executor for the given name.
      Parameters:
      name - The name of the executor
      Returns:
      An executor if it exists
      Since:
      3.1.0
    • selectExecutor

      default Executor selectExecutor(@Nullable io.micronaut.inject.MethodReference<?,?> method, ThreadSelectionConfiguration configuration)
      Select an Executor for the given MethodReference.
      Parameters:
      method - The MethodReference
      configuration - The thread selection configuration
      Returns:
      An optional Executor. If an Executor cannot be established, an ImmediateExecutor is returned.