continues to report as active until all the co-routines are complete? I was expecting the child jobs move to a completed state once they themselves finished, instead of only transitioning to completed when all have done so.
Mark Allanson
06/11/2021, 3:53 PM
Note I mean when I am checking them while still inside the supervisorScope i.e.
Copy code
supervisorScope {
job1 = async { throw ... }
job2 = async { delay(10000) }
while (true) {
delay(1000)
job1.isComplete <-- stays false until after the 10 seconds are up
}
}
Mark Allanson
06/11/2021, 4:25 PM
I found the problem, an extension function I had written to wrap the micrometer
timeCallable
method.
Copy code
/** Times an asynchronous [function] and returns it's result [T]. */
suspend fun <T> Timer.asyncRecordCallable(func: suspend () -> T): T {
return this.recordCallable { runBlocking { func() } }
}