Skip to content

Commit

Permalink
Merge pull request #58 from jreznot/reactive-blocking-annotations
Browse files Browse the repository at this point in the history
Reactive blocking context aware annotations
  • Loading branch information
amaembo authored Aug 12, 2021
2 parents 7c97da5 + 0ad8455 commit a8de8a8
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Changelog
===

Version 22.0.0
---
* Added new annotations: `@Blocking` and `@NonBlocking`.

Version 21.0.1
---
* Multi-Release Jar: Manifest fixed
Expand Down
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import jetbrains.sign.GpgSignSignatoryProvider

buildscript {
repositories {
jcenter()
maven { url "https://packages.jetbrains.team/maven/p/jcs/maven" }
}
dependencies {
Expand Down
20 changes: 20 additions & 0 deletions common/src/main/java/org/jetbrains/annotations/Blocking.java
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 common/src/main/java/org/jetbrains/annotations/NonBlocking.java
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 {
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
# limitations under the License.
#

projectVersion=21.0.1
projectVersion=22.0.0
#JDK_5=<path-to-older-java-version>

0 comments on commit a8de8a8

Please sign in to comment.