Skip to content

Commit

Permalink
Fix Dispatchers.IO_
Browse files Browse the repository at this point in the history
  • Loading branch information
Him188 committed Oct 20, 2024
1 parent 2795897 commit 173cc90
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
4 changes: 1 addition & 3 deletions utils/coroutines/src/commonMain/kotlin/Dispatchers.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ package me.him188.ani.utils.coroutines

import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.IO as _IO

/**
* 跟 `Dispatchers.IO` 一样, 但是在禁用 ios 编译目标后也可以使用 (import 不会被 IDE 自动清除)
*/
inline val Dispatchers.IO_: CoroutineDispatcher
get() = _IO
expect val Dispatchers.IO_: CoroutineDispatcher
19 changes: 19 additions & 0 deletions utils/coroutines/src/jvmMain/kotlin/Dispatchers.jvm.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright (C) 2024 OpenAni and contributors.
*
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
* Use of this source code is governed by the GNU AGPLv3 license, which can be found at the following link.
*
* https://github.com/open-ani/ani/blob/main/LICENSE
*/

package me.him188.ani.utils.coroutines

import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.Dispatchers

/**
* 跟 `Dispatchers.IO` 一样, 但是在禁用 ios 编译目标后也可以使用 (import 不会被 IDE 自动清除)
*/
actual val Dispatchers.IO_: CoroutineDispatcher
get() = IO
20 changes: 20 additions & 0 deletions utils/coroutines/src/nativeMain/kotlin/Dispatchers.native.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright (C) 2024 OpenAni and contributors.
*
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
* Use of this source code is governed by the GNU AGPLv3 license, which can be found at the following link.
*
* https://github.com/open-ani/ani/blob/main/LICENSE
*/

package me.him188.ani.utils.coroutines

import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.IO as _IO

/**
* 跟 `Dispatchers.IO` 一样, 但是在禁用 ios 编译目标后也可以使用 (import 不会被 IDE 自动清除)
*/
actual val Dispatchers.IO_: CoroutineDispatcher
get() = _IO

0 comments on commit 173cc90

Please sign in to comment.