Annotation Type NonBlocking


@Retention(RUNTIME) @Target({METHOD,TYPE}) public @interface NonBlocking
Annotation used to indicate that the annotated method is inherently non-blocking and so can be executed on a non-blockable thread (I/O threads, event loops...) without the need to offload the work to another thread. If the caller thread can be blocked, it should also be safe to execute the method on that thread.

It's up to the framework relying on this annotation do define the exact behavior, like what thread is considered as a non-blockable thread.

When this annotation is used on a class, all the methods declared by the annotated class are considered non-blocking.

This annotation is not inheritable, so the user must repeat the annotation when sub-classing the class or overriding the method.

See Also: