Skip to content

Commit

Permalink
Change delegate workQueue to achieve better performance between calls
Browse files Browse the repository at this point in the history
  • Loading branch information
nbluis committed Apr 10, 2017
1 parent fe422e9 commit da59848
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
Expand All @@ -47,7 +48,7 @@ public class RateLimitExecutorService implements ExecutorService, Runnable {
// killed when the app exits. For synchronous requests this is ideal but it means any async
// requests still pending after termination will be killed.
private final ExecutorService delegate = new ThreadPoolExecutor(Runtime.getRuntime().availableProcessors(), Integer.MAX_VALUE, 60,
TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(),
TimeUnit.SECONDS, new SynchronousQueue<Runnable>(),
threadFactory("Rate Limited Dispatcher", true));

private final BlockingQueue<Runnable> queue = new LinkedBlockingQueue<Runnable>();
Expand Down

0 comments on commit da59848

Please sign in to comment.