groostav
08/15/2017, 8:37 PMsuspend fun Job.cancelAndJoin() = cancel().also { join() }
and am using it preferably to cancel()
. My rationale is that finally{}
and catch{}
blocks in a coroutine might have it taking actions that I'd probably like to have happen sequentially.
does it maye make sense to have an optional argument added ot the cancel()
method to indicate which state you want it to return to you in (either Cancelling
or Cancelled-Completed
)?