isActive
Returns true when this coroutine is still active (has not completed and was not cancelled yet).
Check this property in long-running computation loops to support cancellation:
while (isActive) {
// do some computation
}
This property is a shortcut for coroutineContext[Job]!!.isActive. See coroutineContext and Job.