Reports thread-blocking method calls in code fragments where threads should not be blocked.

Example (Project Reactor):


Flux.just("1").flatMap(f -> {
    Flux<String> just = loadUsersFromDatabase();
    just.toIterable(); // Error: blocking operator call in non-blocking scope
    return just;
  }
);

Consider running blocking code with a proper scheduler, for example Schedulers.boundedElastic(), or try to find an alternative non-blocking API.


Example (Kotlin Coroutines):


suspend fun exampleFun() {
    Thread.sleep(100); // Error: blocking method call inside suspend function
}

Consider running blocking code with a special dispatcher, for example Dispatchers.IO, or try to find an alternative non-blocking API.

Configure the inspection:

Specified annotations can be used as External Annotations