Hello,
I've just realized that I have a long suspending query when calling
kStoreDbIface.userInfo.get()
// commonMain
interface KStoreDbIface {
val userInfo: KStore<UserInfoV1>
}
// android
class KStoreDb(context: Context) : KStoreDbIface {
override val userInfo: KStore<UserInfoV1> = storeOf(
file = Path("${context.filesDir}/user_info.json"),
version = 1,
)
...
}
tested only on Android.
Do you have any idea what might be happening?
My idea is that I'm calling from two coroutines the same kStoreDbIface.userInfo.get(), causing Mutex.withLock to suspend.
If any other coroutine already holds this lock, then another coroutine calling get() will suspend until the first one releases the lock.
Regards!
Hello,
I've just realized that I have a long suspending query when calling
kStoreDbIface.userInfo.get()tested only on Android.
Do you have any idea what might be happening?
My idea is that I'm calling from two coroutines the same
kStoreDbIface.userInfo.get(), causingMutex.withLockto suspend.If any other coroutine already holds this lock, then another coroutine calling get() will suspend until the first one releases the lock.
Regards!