package eu.friedcutlet.yokan.database.room import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.IO /** * The serialized lane used by Room. Views of [Dispatchers.IO] are elastic on JVM and Native * (a private pool, never Darwin's GCD-backed Default), so callers blocked in * [RoomYokanDatabase]'s `runBlocking` bridges cannot starve it of a thread. */ internal val roomPersistenceDispatcher: CoroutineDispatcher = Dispatchers.IO.limitedParallelism(1) /** The separate lane a synchronous replacement blocks on while it waits for [roomPersistenceDispatcher]. */ internal val roomReplacementDispatcher: CoroutineDispatcher = Dispatchers.IO