Skip to content

Commit 3ace44a

Browse files
pvanassenGrover-c13
authored andcommitted
1 parent 84370d5 commit 3ace44a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/com/pokegoapi/main/RequestHandler.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class RequestHandler implements Runnable {
4343
private OkHttpClient client;
4444
private Long requestId = new Random().nextLong();
4545

46-
private final ExecutorService executorService = Executors.newFixedThreadPool(1);
46+
private final Thread asyncHttpThread;
4747
private final BlockingQueue<AsyncServerRequest> workQueue = new LinkedBlockingQueue<>();
4848
private final Map<Long, ResultOrException> resultMap = new HashMap<>();
4949

@@ -59,7 +59,9 @@ public RequestHandler(PokemonGo api, OkHttpClient client) throws LoginFailedExce
5959
this.api = api;
6060
this.client = client;
6161
apiEndpoint = ApiSettings.API_ENDPOINT;
62-
executorService.submit(this);
62+
asyncHttpThread = new Thread(this, "Async HTTP Thread");
63+
asyncHttpThread.setDaemon(true);
64+
asyncHttpThread.start();
6365
}
6466

6567
/**

0 commit comments

Comments
 (0)