Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Kouba <[email protected]>
  • Loading branch information
Ladicek and mkouba authored May 14, 2024
1 parent 5551d45 commit 43e4159
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/src/main/asciidoc/cdi-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1070,15 +1070,15 @@ public class NoopAsyncObserverExceptionHandler implements AsyncObserverException
----

[[reactive_pitfalls]]
== CDI Pitfalls with Reactive Programming
== Pitfalls with Reactive Programming

CDI is a purely synchronous framework.

Check warning on line 1075 in docs/src/main/asciidoc/cdi-reference.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Spelling] Use correct American English spelling. Did you really mean 'asynchrony'? Raw Output: {"message": "[Quarkus.Spelling] Use correct American English spelling. Did you really mean 'asynchrony'?", "location": {"path": "docs/src/main/asciidoc/cdi-reference.adoc", "range": {"start": {"line": 1075, "column": 36}}}, "severity": "WARNING"}
Its notion of asynchrony is very limited and based solely on thread pools and thread offloading.
Therefore, there is a number of pitfalls when using CDI together with reactive programming.

Check warning on line 1077 in docs/src/main/asciidoc/cdi-reference.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.TermsWarnings] Consider using 'several' rather than 'a number of' unless updating existing content that uses the term. Raw Output: {"message": "[Quarkus.TermsWarnings] Consider using 'several' rather than 'a number of' unless updating existing content that uses the term.", "location": {"path": "docs/src/main/asciidoc/cdi-reference.adoc", "range": {"start": {"line": 1077, "column": 3}}}, "severity": "WARNING"}

Check warning on line 1077 in docs/src/main/asciidoc/cdi-reference.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.TermsSuggestions] Depending on the context, consider using 'by using' or 'that uses' rather than 'using'. Raw Output: {"message": "[Quarkus.TermsSuggestions] Depending on the context, consider using 'by using' or 'that uses' rather than 'using'.", "location": {"path": "docs/src/main/asciidoc/cdi-reference.adoc", "range": {"start": {"line": 1077, "column": 28}}}, "severity": "INFO"}

=== Detecting When Blocking Is Allowed

Check warning on line 1079 in docs/src/main/asciidoc/cdi-reference.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.HeadingPunctuation] Do not use end punctuation in headings. Raw Output: {"message": "[Quarkus.HeadingPunctuation] Do not use end punctuation in headings.", "location": {"path": "docs/src/main/asciidoc/cdi-reference.adoc", "range": {"start": {"line": 1079, "column": 1}}}, "severity": "INFO"}

Check warning on line 1079 in docs/src/main/asciidoc/cdi-reference.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Headings] Use sentence-style capitalization in '5.1. Detecting When Blocking Is Allowed'. Raw Output: {"message": "[Quarkus.Headings] Use sentence-style capitalization in '5.1. Detecting When Blocking Is Allowed'.", "location": {"path": "docs/src/main/asciidoc/cdi-reference.adoc", "range": {"start": {"line": 1079, "column": 1}}}, "severity": "INFO"}

The `BlockingOperationControl.isBlockingAllowed()` method allows detecting when blocking is allowed.
The `io.quarkus.runtime.BlockingOperationControl#isBlockingAllowed()` method can be used to detect whether blocking is allowed on the current thread.
When it is not, and you need to perform a blocking operation, you have to offload it to another thread.

Check warning on line 1082 in docs/src/main/asciidoc/cdi-reference.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Fluff] Depending on the context, consider using 'Rewrite the sentence, or use 'must', instead of' rather than 'need to'. Raw Output: {"message": "[Quarkus.Fluff] Depending on the context, consider using 'Rewrite the sentence, or use 'must', instead of' rather than 'need to'.", "location": {"path": "docs/src/main/asciidoc/cdi-reference.adoc", "range": {"start": {"line": 1082, "column": 7}}}, "severity": "INFO"}
The easiest way is to use the `Vertx.executeBlocking()` method:

Expand Down

0 comments on commit 43e4159

Please sign in to comment.