9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-25 09:59:15 +00:00

more virtual thread options

This commit is contained in:
Taiyou06
2025-04-06 14:44:44 +02:00
parent d004ce16ff
commit 4cd885a8c2
3 changed files with 181 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
package org.dreeam.leaf.config.modules.opt;
import org.dreeam.leaf.config.ConfigModules;
import org.dreeam.leaf.config.EnumConfigCategory;
public class VT4DownloadPool extends ConfigModules {
public String getBasePath() {
return EnumConfigCategory.PERF.getBaseKeyName();
}
public static boolean enabled = true;
@Override
public void onLoaded() {
enabled = config.getBoolean(getBasePath() + ".use-virtual-thread-for-download-pool", enabled,
config.pickStringRegionBased(
"Use the new Virtual Thread introduced in JDK 21 for download worker pool.",
"是否为下载工作线程池使用虚拟线程(如果可用)。"));
}
}

View File

@@ -0,0 +1,21 @@
package org.dreeam.leaf.config.modules.opt;
import org.dreeam.leaf.config.ConfigModules;
import org.dreeam.leaf.config.EnumConfigCategory;
public class VT4ProfileExecutor extends ConfigModules {
public String getBasePath() {
return EnumConfigCategory.PERF.getBaseKeyName();
}
public static boolean enabled = true;
@Override
public void onLoaded() {
enabled = config.getBoolean(getBasePath() + ".use-virtual-thread-for-profile-executor", enabled,
config.pickStringRegionBased(
"Use the new Virtual Thread introduced in JDK 21 for profile lookup executor.",
"是否为档案查询执行器使用虚拟线程(如果可用)。"));
}
}