Package io.quarkus.qute
Class ResultsCollectingTemplateInstance
java.lang.Object
io.quarkus.qute.ForwardingTemplateInstance
io.quarkus.qute.ResultsCollectingTemplateInstance
- All Implemented Interfaces:
TemplateInstance
Collects all rendering results for the specified template instance.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.quarkus.qute.TemplateInstance
TemplateInstance.Initializer -
Field Summary
Fields inherited from interface io.quarkus.qute.TemplateInstance
LOCALE, SELECTED_VARIANT, TIMEOUT, VARIANTS -
Constructor Summary
ConstructorsConstructorDescriptionResultsCollectingTemplateInstance(TemplateInstance delegate, BiConsumer<TemplateInstance, String> resultConsumer) -
Method Summary
Modifier and TypeMethodDescriptionTriggers rendering.io.smallrye.mutiny.Multi<String>Create a newMultithat can be used to consume chunks of the rendered template.io.smallrye.mutiny.Uni<String>Create a newUnithat can be used to consume the rendered template.protected TemplateInstancedelegate()render()Triggers rendering.Triggers rendering.Methods inherited from class io.quarkus.qute.ForwardingTemplateInstance
data, data, getAttribute, getFragment, getTemplate, getTimeout, onRendered, setAttributeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.quarkus.qute.TemplateInstance
computedData, setLocale, setLocale, setVariant
-
Constructor Details
-
ResultsCollectingTemplateInstance
public ResultsCollectingTemplateInstance(TemplateInstance delegate, BiConsumer<TemplateInstance, String> resultConsumer)
-
-
Method Details
-
delegate
- Specified by:
delegatein classForwardingTemplateInstance
-
render
Description copied from interface:TemplateInstanceTriggers rendering. Note that this method blocks the current thread!- Specified by:
renderin interfaceTemplateInstance- Overrides:
renderin classForwardingTemplateInstance- Returns:
- the rendered template as string
-
renderAsync
Description copied from interface:TemplateInstanceTriggers rendering.- Specified by:
renderAsyncin interfaceTemplateInstance- Overrides:
renderAsyncin classForwardingTemplateInstance- Returns:
- a completion stage that is completed once the rendering finished
-
createMulti
Description copied from interface:TemplateInstanceCreate a newMultithat can be used to consume chunks of the rendered template. In particular, each item represents a part of the rendered template.This operation does not trigger rendering. Instead, each subscription triggers a new rendering of the template.
- Specified by:
createMultiin interfaceTemplateInstance- Overrides:
createMultiin classForwardingTemplateInstance- Returns:
- a new Multi
- See Also:
-
Multi.subscribe()
-
createUni
Description copied from interface:TemplateInstanceCreate a newUnithat can be used to consume the rendered template.This operation does not trigger rendering. Instead, each subscription triggers a new rendering of the template.
- Specified by:
createUniin interfaceTemplateInstance- Overrides:
createUniin classForwardingTemplateInstance- Returns:
- a new Uni
- See Also:
-
Uni.subscribe()
-
consume
Description copied from interface:TemplateInstanceTriggers rendering.- Specified by:
consumein interfaceTemplateInstance- Overrides:
consumein classForwardingTemplateInstance- Parameters:
consumer- To consume chunks of the rendered template- Returns:
- a completion stage that is completed once the rendering finished
-