New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: @Blocking #7228
Merged
Merged
doc: @Blocking #7228
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e1edf66
Issue 7183 - document `@Blocking` annotation.
wetted 2c2f3d0
Document @Blocking
sdelamo 03f5062
Merge branch '3.4.x' into Issue7183-document-blocking
sdelamo 1c07e8c
Update src/main/docs/guide/httpServer/serverConfiguration/threadPools…
sdelamo e33ddf1
add pool and replace and with or
sdelamo 0aec89e
Update src/main/docs/guide/httpServer/serverConfiguration/threadPools…
sdelamo ac7c6c9
Update src/main/docs/guide/httpServer/serverConfiguration/threadPools…
sdelamo File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
src/main/docs/guide/httpServer/serverConfiguration/threadPools/atBlocking.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,21 @@ | ||
You can use the ann:core.annotation.Blocking[] annotation to mark methods as blocking. | ||
|
||
If you set `micronaut.server.thread-selection` to `AUTO`, The Micronaut Framework offloads the execution of methods annotated with `@Blocking` to the IO thread pool (See: api:io.micronaut.scheduling.TaskExecutors[]). | ||
|
||
NOTE: `@Blocking` only works if you are using `AUTO` thread selection. Micronaut Framework defaults to `MANUAL` thread selection since Micronaut 2.0. We recommend the usage of ann:scheduling.annotation.ExecuteOn[] annotation to execute the blocking operations on a different thread. `@ExecutesOn` works for both `MANUAL` or `AUTO` thread selection. | ||
|
||
There are some places where the Micronaut framework uses ann:core.annotation.Blocking[] already. | ||
sdelamo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|=== | ||
|Blocking Type|Description | ||
|
||
|link:{micronautapi}http/client/BlockingHttpClient.html[BlockingHttpClient] | ||
| Intended for testing, and provides blocking versions for a subset of api:http.client.HttpClient[] operations. | ||
sdelamo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|link:{micronautapi}core/io/IOUtils.html[IOUtils] | ||
| Reads the contents of a `BufferedReader` in a blocking manner, and returns that as a `String`. | ||
|link:{micronautapi}context/env/BootstrapPropertySourceLocator.html[BootstrapPropertySourceLocator] | ||
| Resolves either remote or local api:context.env.PropertySource[] instances for the current `Environment`. | ||
|
||
|=== | ||
|
||
TIP: https://micronaut-projects.github.io/micronaut-data/latest/guide/[Micronaut Data] also utilizes `@Blocking` for some transaction operations, CRUD interceptors, and repositories. | ||
sdelamo marked this conversation as resolved.
Show resolved
Hide resolved
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Micronaut should not be used as a noun to match the brand guidelines. Hence, the
Micronaut Framework
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have incorporated most of your suggestions here: e33ddf1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are gazillion places where simply "Micronaut" is used. Enforcing "Micronaut Framework" in every occurrence in the documentation is quite inappropriate, to say the least.