In a suspend function, is there a way to check if ...
# coroutines
l
In a suspend function, is there a way to check if the calling coroutine is cancelled?
delay
is accessible and does check the cancellation status so there must be a way right?
s
Yes, you can do
coroutineContext.job?.isActive
l
Thanks for the quick answer!
e
coroutineContext.isActive
does the same trick. No need to explicitly find its
job
.