io.smallrye.common.annotation.NonBlocking Maven / Gradle / Ivy
The newest version!
package io.smallrye.common.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* 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 {@code 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 Blocking
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.METHOD, ElementType.TYPE })
public @interface NonBlocking {
// Just a marker annotation.
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy