-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
270 documentation is there any way to reduce the handling time for th…
…e first request (#271) * micronaut flavour version set to 4.7.2 * added documentation for eager startup #270 (added optimization chapter) * [fj-doc-maven-plugin] goal init #270 flavour quarkus-3 added eager init example
- Loading branch information
Showing
14 changed files
with
128 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
fj-doc-guide/src/main/docs/asciidoc/chapters/08_1_eager-startup.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<<< | ||
[#doc-optimize-startup] | ||
== Eager vs Lazy initialization | ||
|
||
By default, Fugerit Venus Doc has a lazy initialization approach. | ||
|
||
In some situation it could be a good idea to have an eager (Ahead Of Time) initialization. | ||
|
||
This can be achieved using a built-in utility : | ||
|
||
_org.fugerit.java.doc.base.config.InitHandler_ | ||
|
||
Here is an example of eager initialization based on Jakarta EE event API. | ||
|
||
[source,java] | ||
---- | ||
package org.fugerit.java.doc.demo; | ||
import io.quarkus.runtime.StartupEvent; | ||
import jakarta.enterprise.context.ApplicationScoped; | ||
import jakarta.enterprise.event.Observes; | ||
import jakarta.inject.Inject; | ||
import org.fugerit.java.doc.base.config.InitHandler; | ||
@ApplicationScoped | ||
public class AppInit { | ||
@Inject | ||
DocHelper docHelper; | ||
void onStart(@Observes StartupEvent ev) { | ||
/* | ||
* This will initialize all the doc handlers using async mode. | ||
* (use method InitHandler.initDocAll() for synced startup) | ||
*/ | ||
InitHandler.initDocAllAsync( | ||
docHelper.getDocProcessConfig().getFacade().handlers() ); | ||
} | ||
} | ||
---- | ||
|
||
NOTE: This will initialize all the doc handlers specified as arguments by trying to create a link:https://github.com/fugerit-org/fj-doc/blob/main/fj-doc-base/src/main/resources/config/init_doc/doc-init.xml[simple document]. |
5 changes: 5 additions & 0 deletions
5
fj-doc-guide/src/main/docs/asciidoc/chapters/08_doc-optmization.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<<< | ||
[#doc-optimization] | ||
== Optimizations | ||
|
||
In this chapter the main Venus optimizations ara described. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
fj-doc-maven-plugin/src/main/resources/config/flavour/flavour_versions_default.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# default flavour versions | ||
quarkus-3=3.17.4 | ||
quarkus-2=2.16.12.Final | ||
micronaut-4=4.7.1 | ||
micronaut-4=4.7.2 | ||
springboot-3=3.4.0 | ||
openliberty=24.0.0.11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
fj-doc-maven-plugin/src/main/resources/config/template/flavour/quarkus-3/DocHelper.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<#import '../flavour-macro.ftl' as fhm> | ||
package <@fhm.toProjectPackage context=context/>; | ||
|
||
import org.fugerit.java.doc.freemarker.process.FreemarkerDocProcessConfig; | ||
import org.fugerit.java.doc.freemarker.process.FreemarkerDocProcessConfigFacade; | ||
import jakarta.enterprise.context.ApplicationScoped; | ||
|
||
@ApplicationScoped | ||
public class DocHelper { | ||
|
||
private FreemarkerDocProcessConfig docProcessConfig = FreemarkerDocProcessConfigFacade.loadConfigSafe( "cl://${context.resourcePathFmConfigXml}" ); | ||
|
||
public FreemarkerDocProcessConfig getDocProcessConfig() { return this.docProcessConfig; } | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters