-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bump(deps): Kotlin from 2.0.10 to 2.0.20
- Loading branch information
1 parent
af72957
commit 3d0773e
Showing
15 changed files
with
109 additions
and
132 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* Project https://github.com/simple-robot/simpler-robot | ||
* Email [email protected] | ||
* | ||
* This file is part of the Simple Robot Library. | ||
* This file is part of the Simple Robot Library (Alias: simple-robot, simbot, etc.). | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
|
@@ -36,8 +36,13 @@ internal actual fun ioDispatcher(): CoroutineDispatcher? = Dispatchers.IO | |
/** | ||
* 获取自定义调度器。 | ||
* | ||
* native 平台下 [maxThreads] 和 [keepAliveMillis] 无效 | ||
* 基于 [Dispatchers.IO], | ||
* 使用 [CoroutineDispatcher.limitedParallelism]。 | ||
Check warning on line 40 in simbot-api/src/nativeMain/kotlin/love/forte/simbot/bot/configuration/DispatcherConfiguration.native.kt
|
||
* | ||
* native 平台下 [maxThreads] 和 [keepAliveMillis] 无效。 | ||
* | ||
* @see CoroutineDispatcher.limitedParallelism | ||
Check warning on line 44 in simbot-api/src/nativeMain/kotlin/love/forte/simbot/bot/configuration/DispatcherConfiguration.native.kt
|
||
* @see newFixedThreadPoolContext | ||
*/ | ||
internal actual fun customDispatcher( | ||
coreThreads: Int?, | ||
|
@@ -48,7 +53,8 @@ internal actual fun customDispatcher( | |
val core = coreThreads ?: return null | ||
require(core <= 1) { "'coreThreads' must >= 1, but $core" } | ||
|
||
return newFixedThreadPoolContext(core, name ?: "Custom-DP.FT.$core") | ||
return Dispatchers.IO.limitedParallelism(core, name ?: "Custom-DP.FT.$core") | ||
// return newFixedThreadPoolContext(core, name ?: "Custom-DP.FT.$core") | ||
} | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters