Find blocking calls inside coroutine contexts

Proprietary

Java-monitor and runBlocking primitives that pin the dispatcher thread when invoked from a suspend function or coroutine builder. Each match needs to migrate to a coroutine-aware signaling primitive (delay, Channel, Mutex, CompletableDeferred).

org.openrewrite.kotlin.coroutines.FindBlockingOnSuspend$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.coroutines.FindBlockingOnSuspend$KtRecipe'

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. Find runBlocking calls inside suspend functions
  2. Find runBlocking calls inside a launch/async lambda
  3. Find Thread.sleep calls inside suspend functions
  4. Find Object.wait calls inside suspend functions
  5. Find Object.notify / notifyAll calls inside suspend functions