Class BlockingExecutionConfigurer
java.lang.Object
org.springframework.web.reactive.config.BlockingExecutionConfigurer
Helps to configure options related to blocking execution in WebFlux.
- Since:
- 6.1
- Author:
- Rossen Stoyanchev
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Predicate<org.springframework.web.method.HandlerMethod>
protected org.springframework.core.task.AsyncTaskExecutor
setControllerMethodPredicate
(Predicate<org.springframework.web.method.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.setExecutor
(org.springframework.core.task.AsyncTaskExecutor executor) Configure an executor to invoke blocking controller methods with.
-
Constructor Details
-
BlockingExecutionConfigurer
public BlockingExecutionConfigurer()
-
-
Method Details
-
setExecutor
public BlockingExecutionConfigurer setExecutor(org.springframework.core.task.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<org.springframework.web.method.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 org.springframework.core.task.AsyncTaskExecutor getExecutor() -
getBlockingControllerMethodPredicate
@Nullable protected Predicate<org.springframework.web.method.HandlerMethod> getBlockingControllerMethodPredicate()
-