s1m0nw1
07/08/2017, 6:59 AMmain
would terminate before all outputs can be observed. I get what you mean though and updated it to:
runBlocking(CommonPool) { //(1)
val job = launch(CommonPool) {
sendEmailSuspending() //(2)
println("Email sent successfully.")
}
job.join() //(9)
println("Finished")
}
Now we want to do something after the email was sent which makes join reasonable. All right?