Skip to content

Commit

Permalink
Merge pull request #28630 from mkouba/qute-uni-memoize-docs
Browse files Browse the repository at this point in the history
Qute docs - add a note about evaluation of Uni
  • Loading branch information
gsmet committed Oct 17, 2022
2 parents 5c60613 + d1961ce commit 5df6480
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/src/main/asciidoc/qute-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,8 @@ If a part of an expression resolves to a `CompletionStage`, the resolution conti
For example, if there is an expression `{foo.size}` and `foo` resolves to `CompletionStage<List<String>>` then `size` is resolved against the completed result, i.e. `List<String>`.
If a part of an expression resolves to a `Uni`, a `CompletionStage` is first created from `Uni` using `Uni#subscribeAsCompletionStage()` and then evaluated as described above.

IMPORTANT: Note that each `Uni#subscribeAsCompletionStage()` results in a new subscription. You might need to configure memoization of the `Uni` item or failure before it's used as template data, i.e. `myUni.memoize().indefinitely()`.

It can happen that a `CompletionStage` never completes or a `Uni` emits no item/failure.
In this case, the rendering methods (such as `TemplateInstance#render()` and `TemplateInstance#createUni()`) fail after a specific timeout.
The timeout can be specified as a template instance `timeout` attribute.
Expand Down

0 comments on commit 5df6480

Please sign in to comment.