Class BlockingExecutionConfigurer

java.lang.Object
org.springframework.web.reactive.config.BlockingExecutionConfigurer

public class BlockingExecutionConfigurer extends Object
Helps to configure options related to blocking execution in WebFlux.
Since:
6.1
Author:
Rossen Stoyanchev
  • Constructor Details

    • BlockingExecutionConfigurer

      public BlockingExecutionConfigurer()
  • Method Details

    • setExecutor

      public BlockingExecutionConfigurer setExecutor(AsyncTaskExecutor executor)
      Configure an executor to invoke blocking controller methods with.

      By default, this is not set in which case controller methods are invoked without the use of an Executor.

      Parameters:
      executor - the task executor to use
    • setControllerMethodPredicate

      public BlockingExecutionConfigurer setControllerMethodPredicate(Predicate<HandlerMethod> predicate)
      Configure a predicate to decide if a controller method is blocking and should be called on a separate thread if an executor is configured.

      The default predicate matches controller methods whose return type is not recognized by the configured ReactiveAdapterRegistry.

      Parameters:
      predicate - the predicate to use
    • getExecutor

      @Nullable protected AsyncTaskExecutor getExecutor()
    • getBlockingControllerMethodPredicate

      @Nullable protected Predicate<HandlerMethod> getBlockingControllerMethodPredicate()