Skip to content

Commit

Permalink
Qute getting started guide - remove outdated section about async APIs
Browse files Browse the repository at this point in the history
- resolves quarkusio#28230

(cherry picked from commit 6c612ac)
  • Loading branch information
mkouba authored and gsmet committed Oct 3, 2022
1 parent d5b0f1a commit 8a6d36c
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions docs/src/main/asciidoc/qute.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -498,29 +498,6 @@ public class ReportGenerator {
<2> Use the `@Scheduled` annotation to instruct Quarkus to execute this method on the half hour. For more information see the xref:scheduler.adoc[Scheduler] guide.
<3> The `TemplateInstance.render()` method triggers rendering. Note that this method blocks the current thread.

== Reactive and Asynchronous APIs

Templates can be rendered as a `CompletionStage<String>` (completed with the rendered output asynchronously) or as `Publisher<String>` containing the rendered chunks:

[source, java]
----
CompletionStage<String> async = template.data("name", "neo").renderAsync();
Publisher<String> publisher = template.data("name", "neo").publisher();
----

In the case of a `Publisher`, the template is rendered chunk by chunk following the requests from the subscriber.
The rendering is not started until a subscriber requests it.
The returned `Publisher` is an instance of `io.smallrye.mutiny.Multi`.

It is possible to create an instance of `io.smallrye.mutiny.Uni` as follows:

[source, java]
----
Uni<String> uni = Uni.createFrom().completionStage(() -> template.data("name", "neo").renderAsync());
----

In this case, the rendering only starts once the subscriber requests it.

== Qute Reference Guide

To learn more about Qute, please refer to the xref:qute-reference.adoc[Qute reference guide].
Expand Down

0 comments on commit 8a6d36c

Please sign in to comment.