@@ -24,6 +24,8 @@ public final class OkHttpSpawnClient implements SpawnClient {
2424 private final int proxyPort ;
2525 private final OkHttpClient client ;
2626
27+ private final OkHttpClient spawnClient ;
28+
2729 public OkHttpSpawnClient (String system , String proxyHost , int proxyPort ) {
2830 this .system = system ;
2931 this .proxyHost = proxyHost ;
@@ -36,6 +38,14 @@ public OkHttpSpawnClient(String system, String proxyHost, int proxyPort) {
3638 .retryOnConnectionFailure (true )
3739 .connectionPool (new ConnectionPool (256 , 100 , TimeUnit .SECONDS ))
3840 .build ();
41+
42+ this .spawnClient = new OkHttpClient .Builder ()
43+ .connectTimeout (60 , TimeUnit .SECONDS )
44+ .readTimeout (60 , TimeUnit .SECONDS )
45+ .writeTimeout (60 , TimeUnit .SECONDS )
46+ .callTimeout (200 , TimeUnit .SECONDS )
47+ .connectionPool (new ConnectionPool (256 , 100 , TimeUnit .SECONDS ))
48+ .build ();
3949 }
4050
4151 @ Override
@@ -63,7 +73,7 @@ public Protocol.SpawnResponse spawn(Protocol.SpawnRequest registration) throws A
6373 .url (makeSpawnURLFrom (registration .getActors (0 ).getSystem ()))
6474 .post (body ).build ();
6575
66- Call call = client .newCall (request );
76+ Call call = spawnClient .newCall (request );
6777 try (Response response = call .execute ()) {
6878 assert response .body () != null ;
6979 return io .eigr .functions .protocol .Protocol .SpawnResponse .parseFrom (
0 commit comments