Skip to content

Commit

Permalink
Rename async methods (put async at end)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Froh <froh@amazon.com>
  • Loading branch information
msfroh committed Oct 27, 2023
1 parent 6f823bd commit 70567bd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ void transformRequest(SearchRequest request, ActionListener<SearchRequest> reque
currentListener = ActionListener.wrap(r -> {
long start = relativeTimeSupplier.getAsLong();
beforeRequestProcessor(processor);
processor.asyncProcessRequest(r, ActionListener.wrap(rr -> {
processor.processRequestAsync(r, ActionListener.wrap(rr -> {
long took = TimeUnit.NANOSECONDS.toMillis(relativeTimeSupplier.getAsLong() - start);
afterRequestProcessor(processor, took);
nextListener.onResponse(rr);
Expand Down Expand Up @@ -219,7 +219,7 @@ ActionListener<SearchResponse> transformResponseListener(SearchRequest request,
responseListener = ActionListener.wrap(r -> {
beforeResponseProcessor(processor);
final long start = relativeTimeSupplier.getAsLong();
processor.asyncProcessResponse(request, r, ActionListener.wrap(rr -> {
processor.processResponseAsync(request, r, ActionListener.wrap(rr -> {
long took = TimeUnit.NANOSECONDS.toMillis(relativeTimeSupplier.getAsLong() - start);
afterResponseProcessor(processor, took);
currentFinalListener.onResponse(rr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public interface SearchRequestProcessor extends Processor {
* @param request the executed {@link SearchRequest}
* @param requestListener callback to be invoked on successful processing or on failure
*/
default void asyncProcessRequest(SearchRequest request, ActionListener<SearchRequest> requestListener) {
default void processRequestAsync(SearchRequest request, ActionListener<SearchRequest> requestListener) {
try {
requestListener.onResponse(processRequest(request));
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public interface SearchResponseProcessor extends Processor {
* @param response the current {@link SearchResponse}, possibly modified by earlier processors
* @param responseListener callback to be invoked on successful processing or on failure
*/
default void asyncProcessResponse(SearchRequest request, SearchResponse response, ActionListener<SearchResponse> responseListener) {
default void processResponseAsync(SearchRequest request, SearchResponse response, ActionListener<SearchResponse> responseListener) {
try {
responseListener.onResponse(processResponse(request, response));
} catch (Exception e) {
Expand Down

0 comments on commit 70567bd

Please sign in to comment.