VirtualThread

This commit is contained in:
2025-06-17 17:09:34 +08:00
parent 5f8c4fd6e6
commit 7d6c87cc74
8 changed files with 17 additions and 11 deletions

View File

@@ -103,13 +103,13 @@ public class VideoPieceGetter {
return;
}
log.info("poll task: {}/{}", task, queue.size());
new Thread(() -> {
Thread.ofVirtual().start(() -> {
try {
runTask(task);
} catch (Exception e) {
log.error("run task error", e);
}
}).start();
});
}
private void runTask(Task task) {