Kotlin is doing something like this with coroutine cancellation. Not quite the same because the cancelation requires cooperation but I reckon you could add a timeout and get the composability that the article talks about
https://kotlinlang.org/docs/reference/coroutines/cancellatio...