Paul Woitaschek
02/03/2022, 3:36 PMDeferred
For await
, it says:
[…] If the Job of the current coroutine is cancelled or completed while this suspending function is waiting, this function immediately resumes with CancellationException. […]Why would the await function resume with a CancellationException if the job completes while await is waiting?
Joffrey
02/03/2022, 5:55 PMawait
anyway. But it's indeed a bit confusing that they mention "completed" as an option here 🤔Nick Allen
02/03/2022, 7:57 PMCompletableJob
using withContext
and complete it while await
is called.
Edit: had a play link here, but mistyped it so it was inaccurate.Nick Allen
02/03/2022, 8:01 PMPaul Woitaschek
02/03/2022, 8:40 PM