Marc Knaup
07/02/2020, 1:06 PMSuspendCloseable
? 🤔
I have to delete a temporary file in close()
but don’t want it to be a blocking call.Zach Klippenstein (he/him) [MOD]
07/02/2020, 4:39 PMMarc Knaup
07/02/2020, 5:13 PMclose()
and use()
) they have to dispatch to another context while everything else are suspend functions already.
Also it messes up the code because it requires adding a wrapping boilerplate at every single call site.Zach Klippenstein (he/him) [MOD]
07/02/2020, 5:16 PMclose
method in which you want to do something with a temp file, but not block the caller. In that case, you could launch a coroutine internally to do that.Marc Knaup
07/02/2020, 5:22 PMZach Klippenstein (he/him) [MOD]
07/02/2020, 5:25 PMMarc Knaup
07/02/2020, 5:27 PMZach Klippenstein (he/him) [MOD]
07/02/2020, 5:28 PMMarc Knaup
07/02/2020, 5:38 PM