Skip to content

Commit

Permalink
Use directExecutor().
Browse files Browse the repository at this point in the history
Guava 18 deprecated sameThreadExecutor() and split
the use case into two options:
newDirectExecutorService() and directExecutor().
Use directExecutor() as we don't need
ExecutorService#shutdown semantics and this
has a positive performance impact.

Signed-off-by: Luke Inman-Semerau <[email protected]>
  • Loading branch information
joshbruning authored and lukeis committed Jul 31, 2015
1 parent 5556f0a commit b94b265
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public ListenableFuture<String> send(String data) {
public void run() {
pendingResponse.compareAndSet(response, null);
}
}, MoreExecutors.sameThreadExecutor());
}, MoreExecutors.directExecutor());

if (pendingResponse.compareAndSet(null, response)) {
TextWebSocketFrame frame = new TextWebSocketFrame(data);
Expand Down

0 comments on commit b94b265

Please sign in to comment.