-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from jreznot/reactive-blocking-annotations
Reactive blocking context aware annotations
- Loading branch information
Showing
5 changed files
with
45 additions
and
2 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
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
20 changes: 20 additions & 0 deletions
20
common/src/main/java/org/jetbrains/annotations/Blocking.java
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,20 @@ | ||
package org.jetbrains.annotations; | ||
|
||
import java.lang.annotation.*; | ||
|
||
/** | ||
* Indicates that the annotated method is inherently blocking and should not be executed in a non-blocking context. | ||
* <p> | ||
* When this annotation is used on a {@code class}, all the methods declared by the annotated class are considered | ||
* <em>blocking</em>. | ||
* <p> | ||
* Apart from documentation purposes this annotation is intended to be used by static analysis tools to validate against | ||
* probable runtime errors and element contract violations. | ||
* | ||
* @since 22.0.0 | ||
*/ | ||
@Documented | ||
@Retention(RetentionPolicy.CLASS) | ||
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.TYPE}) | ||
public @interface Blocking { | ||
} |
20 changes: 20 additions & 0 deletions
20
common/src/main/java/org/jetbrains/annotations/NonBlocking.java
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,20 @@ | ||
package org.jetbrains.annotations; | ||
|
||
import java.lang.annotation.*; | ||
|
||
/** | ||
* Indicates that the annotated method is inherently non-blocking and can be executed in a non-blocking context. | ||
* <p> | ||
* When this annotation is used on a {@code class}, all the methods declared by the annotated class are considered | ||
* <em>non-blocking</em>. | ||
* <p> | ||
* Apart from documentation purposes this annotation is intended to be used by static analysis tools to validate against | ||
* probable runtime errors and contract violations. | ||
* | ||
* @since 22.0.0 | ||
*/ | ||
@Documented | ||
@Retention(RetentionPolicy.CLASS) | ||
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.TYPE}) | ||
public @interface NonBlocking { | ||
} |
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