Top Description Fields Constructors Methods
org.springframework.web.reactive.config

public Class BlockingExecutionConfigurer

extends Object
Class Inheritance
Imports
java.util.function.Predicate, org.springframework.core.task.AsyncTaskExecutor, org.springframework.lang.Nullable, org.springframework.web.method.HandlerMethod

Helps to configure options related to blocking execution in WebFlux.
Author
Rossen Stoyanchev
Since
6.1

Field Summary

Modifier and TypeField and Description
private Predicate<HandlerMethod>
private AsyncTaskExecutor

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected Predicate<HandlerMethod>
protected AsyncTaskExecutor
public BlockingExecutionConfigurer
setControllerMethodPredicate(Predicate<HandlerMethod>
the predicate to use
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.

public BlockingExecutionConfigurer
setExecutor(AsyncTaskExecutor
the task executor to use
executor
)

Configure an executor to invoke blocking controller methods with.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

blockingControllerMethodPredicateback to summary
private Predicate<HandlerMethod> blockingControllerMethodPredicate
Annotations
@Nullable
executorback to summary
private AsyncTaskExecutor executor
Annotations
@Nullable

Constructor Detail

BlockingExecutionConfigurerback to summary
public BlockingExecutionConfigurer()

Method Detail

getBlockingControllerMethodPredicateback to summary
protected Predicate<HandlerMethod> getBlockingControllerMethodPredicate()
Annotations
@Nullable
getExecutorback to summary
protected AsyncTaskExecutor getExecutor()
Annotations
@Nullable
setControllerMethodPredicateback to summary
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 org.springframework.core.ReactiveAdapterRegistry.

Parameters
predicate:Predicate<HandlerMethod>

the predicate to use

setExecutorback to summary
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:AsyncTaskExecutor

the task executor to use