Skip to content

Commit 7ef6665

Browse files
committed
Use cached thread pool instead of virtual threads for compatibility reasons
1 parent a97a9f9 commit 7ef6665

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: src/main/java/io/eigr/spawn/Spawn.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111
import io.eigr.spawn.internal.client.OkHttpSpawnClient;
1212
import io.eigr.spawn.internal.client.SpawnClient;
1313
import io.eigr.spawn.internal.handlers.ActorServiceHandler;
14+
import org.jetbrains.annotations.NotNull;
1415

1516
import java.io.IOException;
1617
import java.net.InetSocketAddress;
1718
import java.util.*;
1819
import java.util.concurrent.Executors;
20+
import java.util.concurrent.ThreadFactory;
1921
import java.util.function.Function;
2022
import java.util.stream.Collectors;
2123

@@ -75,7 +77,8 @@ public ActorRef createActorRef(String system, String name, String parent) {
7577
private void startServer() throws IOException {
7678
HttpServer httpServer = HttpServer.create(new InetSocketAddress(this.port), 0);
7779
httpServer.createContext("/api/v1/actors/actions", new ActorServiceHandler(this.system, this.entities));
78-
httpServer.setExecutor(Executors.newVirtualThreadPerTaskExecutor());
80+
//httpServer.setExecutor(Executors.newVirtualThreadPerTaskExecutor());
81+
httpServer.setExecutor(Executors.newCachedThreadPool());
7982
httpServer.start();
8083
}
8184

0 commit comments

Comments
 (0)