Andrew
03/14/2020, 4:13 AMZach Klippenstein (he/him) [MOD]
03/14/2020, 4:30 AMimport kotlinx.coroutines.sync.Mutex
private val lock = Mutex()
…
lock.withLock {
// critical section
}
Andrew
03/14/2020, 4:40 AMtseisel
03/14/2020, 8:37 AMasync
, then keep the resulting Deferred
. The result of the HTTP call will be cached for next function calls, requiring no synchronizationKroppeb
03/14/2020, 10:47 AM