Open sdelamo opened 10 months ago
🤔 So, we could do this by making @Blocking
into an Around
annotation with a Type
to handle the wrapping.
@Blocking
is in micronaut-core
, @Type
is in micronaut-inject
and @Around
is in micronaut-aop
so we would need to move things around (which I believe would mean this is delayed until micronaut 5.0.0 due to it being a blocking change?)
Unless there's a programatic way of wrapping each Blocking
method or class in.a check for the Netty event-loop threads...
We have an annotation
@Blocking
@yawkat added a really useful PR to detect blocking usages of
@BlockingClient
in a Netty event loop thread.BlockingHttpClient is annotated with
@Blocking
.Micronaut Data's CrudRepository repository is annotated with
@Blocking
as well. We have other instances throughout the framework.We could enhance the @yawkat block detector to detect when an application executes a method annotated with
@Blocking
in a Netty event loop thread and, in that case, throw an exception.@micronaut-projects/core-developers thoughts?