Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
24 additions
and
18 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
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. | ||
|
||
|=== | ||
|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. | ||
|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. |
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