Skip to content

Commit 920b57d

Browse files
committed
Revert detach of context when running on event-loop (we lose a bit of performance)
1 parent cd662f3 commit 920b57d

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

jooby/src/main/java/io/jooby/internal/Pipeline.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,6 @@ public static Handler compute(ClassLoader loader, Route route, ExecutionMode mod
133133
}
134134
/** Context: */
135135
if (Context.class.isAssignableFrom(type)) {
136-
if (executor == null && mode == ExecutionMode.EVENT_LOOP) {
137-
return next(mode, executor, new DetachHandler(decorate(route)), false);
138-
}
139136
return next(mode, executor, decorate(route, new SendDirect(route.getPipeline())), true);
140137
}
141138
/** InputStream: */
@@ -176,10 +173,6 @@ public static Handler compute(ClassLoader loader, Route route, ExecutionMode mod
176173
return next(mode, executor, decorate(route, new DefaultHandler(route.getPipeline())), true);
177174
}
178175

179-
private static Handler decorate(Route route) {
180-
return decorate(route, route.getPipeline());
181-
}
182-
183176
private static Handler decorate(Route route, Handler handler) {
184177
Handler pipeline = handler;
185178
if (route.isHttpHead()) {

tests/src/test/java/io/jooby/FeaturedTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2339,7 +2339,8 @@ public void accessToFlashScopeFromTemplateEngine(ServerTestRunner runner) {
23392339
});
23402340
}
23412341

2342-
@ServerTest(executionMode = EVENT_LOOP)
2342+
// TODO: We might add this back but using a different implementation:
2343+
// @ServerTest(executionMode = EVENT_LOOP)
23432344
@DisplayName("Context detaches when running in event-loop and returns a Context")
23442345
public void detachOnEventLoop(ServerTestRunner runner) {
23452346
runner.define(app -> {

0 commit comments

Comments
 (0)