Skip to content

Commit 4efe252

Browse files
committed
auto-shrink AsyncServer.synchronousWorkers threadpool when idle
1 parent 910e3c8 commit 4efe252

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

AndroidAsync/src/com/koushikdutta/async/AsyncServer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,8 @@ public Cancellable connectSocket(final String host, final int port, final Connec
403403

404404
private static ExecutorService newSynchronousWorkers() {
405405
ThreadFactory tf = new NamedThreadFactory("AsyncServer-worker-");
406-
ThreadPoolExecutor tpe = new ThreadPoolExecutor(4, 4, 0L,
407-
TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(), tf);
406+
ThreadPoolExecutor tpe = new ThreadPoolExecutor(1, 4, 10L,
407+
TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), tf);
408408
return tpe;
409409
}
410410

0 commit comments

Comments
 (0)