RoomDispatchers.kt
composeApp/src/nonWebMain/kotlin/eu/friedcutlet/yokan/database/room/RoomDispatchers.kt
1package eu.friedcutlet.yokan.database.room23import kotlinx.coroutines.CoroutineDispatcher4import kotlinx.coroutines.Dispatchers5import kotlinx.coroutines.IO67/**8 * The serialized lane used by Room. Views of [Dispatchers.IO] are elastic on JVM and Native9 * (a private pool, never Darwin's GCD-backed Default), so callers blocked in10 * [RoomYokanDatabase]'s `runBlocking` bridges cannot starve it of a thread.11 */12internal val roomPersistenceDispatcher: CoroutineDispatcher = Dispatchers.IO.limitedParallelism(1)1314/** The separate lane a synchronous replacement blocks on while it waits for [roomPersistenceDispatcher]. */15internal val roomReplacementDispatcher: CoroutineDispatcher = Dispatchers.IO16