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.
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.

=== Detecting When Blocking Is Allowed

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.
The easiest way is to use the `Vertx.executeBlocking()` method:

Expand Down

0 comments on commit 43e4159

Please sign in to comment.