Open sdelamo opened 2 years ago
An alternative would be to remove @Blocking
as suggested by @jameskleeh. An advantage to remove the annotation would be to have a single way of doing things.
@Blocking
requires the user to read the javadoc to know what thread it executes on but @ExecuteOn
makes it clear immediately
Issue description
I think for Micronaut 4.0, if a user adds
@Blocking
to a method and they are using the Netty runtime the behaviour should be identical as if they use@ExecuteOn(TaskExecutors.IO)
.I think
@Blocking
is a more idiomatic annotation which conveys what the codes does. Then it is up to the runtime to execute it in a different thread pool if applies.We are already using
@Blocking
in Micronaut Data CRUD repositoriesCurrently,
@Blocking
only works forAUTO
thread selection. Since Micronaut 2.0 thread section defaults to manual.