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
  • Loading branch information
mkouba authored and igorregis committed Oct 16, 2022
1 parent ed8eb7e commit a998e10
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 a998e10

Please sign in to comment.