Skip to content
This repository was archived by the owner on May 28, 2018. It is now read-only.

Commit 1205156

Browse files
committed
CompletionStage returned from the resource method will use completer thread for response processing.
Change-Id: Ibea972c19a0133ca63a6ba9f9716356c7932c86f
1 parent cd6aa58 commit 1205156

File tree

3 files changed

+1
-15
lines changed

3 files changed

+1
-15
lines changed

core-server/src/main/java/org/glassfish/jersey/server/ServerRuntime.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -854,11 +854,6 @@ public void run() {
854854
});
855855
}
856856

857-
@Override
858-
public void invokeManaged(Runnable runnable) {
859-
responder.runtime.managedAsyncExecutor.get().submit(runnable);
860-
}
861-
862857
@Override
863858
public boolean suspend() {
864859
synchronized (stateLock) {

core-server/src/main/java/org/glassfish/jersey/server/internal/process/AsyncContext.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,4 @@ public static enum State {
9797
* @param producer response producer.
9898
*/
9999
public void invokeManaged(Producer<Response> producer);
100-
101-
/**
102-
* Invoke the provided runnable in a Jersey-managed asynchronous thread.
103-
*
104-
* @param runnable to be invoked.
105-
*/
106-
public void invokeManaged(Runnable runnable);
107100
}

core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethodInvoker.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -426,9 +426,7 @@ public ContainerResponse apply(final RequestProcessingContext processingContext)
426426
}
427427

428428
// wait for a response
429-
completableFuture.whenCompleteAsync(
430-
whenComplete(processingContext),
431-
command -> processingContext.asyncContext().invokeManaged(command));
429+
completableFuture.whenComplete(whenComplete(processingContext));
432430

433431
return null; // return null on the current thread
434432
}

0 commit comments

Comments
 (0)