Support Callable as a controller method return value

Closes gh-316
This commit is contained in:
rstoyanchev
2022-05-16 08:47:58 +01:00
parent 735da030e8
commit e083dc8615
13 changed files with 275 additions and 57 deletions

View File

@@ -1227,8 +1227,13 @@ See <<controllers-schema-mapping-data-loader>>.
|===
Schema mapping handler methods can return any value, including Reactor `Mono` and
`Flux` as described in <<execution-reactive-datafetcher>>.
Schema mapping handler methods can return:
- A resolved value of any type.
- `Mono` and `Flux` for asynchronous value(s). Supported for controller methods and for
any `DataFetcher` as described in <<execution-reactive-datafetcher>>.
- `java.util.concurrent.Callable` to have the value(s) produced asynchronously.
For this to work, `AnnotatedControllerConfigurer` must be configured with an `Executor`.
@@ -1574,6 +1579,10 @@ Batch mapping methods can return:
| `Map<K,V>`, `Collection<V>`
| Imperative variants, e.g. without remote calls to make.
| `Callable<Map<K,V>>`, `Callable<Collection<V>>`
| Imperative variants to be invoked asynchronously. For this to work,
`AnnotatedControllerConfigurer` must be configured with an `Executor`.
|===