Hey guys! Is it possible for a coroutine to cancel...
# announcements
l
Hey guys! Is it possible for a coroutine to cancel a potentially infinite loop? I believe it's not, and I can't do it either:
Copy code
GlobalScope.launch {
  val deferred = GlobalScope.async {
    while (true) {

    }
  }

  val result = withTimeout(100) {
    deferred.await()
  }

  println(result)
}