Skip to content

Commit

Permalink
Ensure worker is used for async dispatch.
Browse files Browse the repository at this point in the history
  • Loading branch information
noboomu committed Sep 15, 2020
1 parent b1dad4d commit 6482aac
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ Proteus Changelog.
## Unreleased
### No issue

**Send**


[ee7ad65ed114816](https://github.com/noboomu/proteus/commit/ee7ad65ed114816) Joshua Bauer *2020-09-15 16:11:53*

**Remove empty server responses.**


[5ce38822c3dd229](https://github.com/noboomu/proteus/commit/5ce38822c3dd229) joshua bauer *2020-09-15 04:56:32*

**Remove further looping state for server responses.**


[487d57cae528b14](https://github.com/noboomu/proteus/commit/487d57cae528b14) joshua bauer *2020-09-15 04:55:00*

**Expose socket timeouts.**


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -677,13 +677,13 @@ protected void addClassMethodHandlers(TypeSpec.Builder typeBuilder, Class<?> cla


if (m.getReturnType().equals(ServerResponse.class)) {
methodBuilder.addStatement("$L.send($L)", "response", "exchange");
methodBuilder.addStatement("$L.send(this,$L)", "response", "exchange");

} else if ((m.getGenericReturnType().toString().contains("java.util.concurrent.CompletionStage") && m.getGenericReturnType().toString().contains("ServerResponse"))
|| (m.getGenericReturnType().toString().contains("java.util.concurrent.CompletableFuture") && m.getGenericReturnType().toString().contains("ServerResponse")))

{
methodBuilder.addCode("exchange.dispatch( () -> ");
methodBuilder.addCode("exchange.dispatch( exchange.getConnection().getWorker(), () -> ");
methodBuilder.beginControlFlow("", "");

methodBuilder.addCode(
Expand Down Expand Up @@ -715,7 +715,7 @@ else if (m.getReturnType().getTypeName().contains("java.util.concurrent.Completi
postProcess = ".";
}
}
methodBuilder.addCode("exchange.dispatch( () -> ");
methodBuilder.addCode("exchange.dispatch( exchange.getConnection().getWorker(), () -> ");
methodBuilder.beginControlFlow("", "");


Expand Down

0 comments on commit 6482aac

Please sign in to comment.