-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Virtual-Threads Support for quarkus-reactive-routes #36430
Comments
/cc @cescoffier (virtual-threads), @ozangunalp (virtual-threads) |
Well, a reactive route executed on a virtual thread sounds a bit like an oxymoron but it should be quite straightforward to implement ;-). We would have to wrap the generated handler and execute it on the event loop. Something like this should work: public void handle(RoutingContext context) {
Context vertxContext = VertxContext.getOrCreateDuplicatedContext(VertxCoreRecorder.getVertx().get());
VertxContextSafetyToggle.setContextSafe(context, true);
vertxContext.runOnContext(new Handler<Void>() {
@Override
public void handle(Void event) {
VirtualThreadsRecorder.getCurrent().execute(new Runnable() {
@Override
public void run() {
generatedHandler.handle(context);
}
});
}
});
} WDYT @cescoffier |
That's right, I should have an ADR we can discuss in the team meeting next week |
Description
At mid-Oct 2023, "quarkus-resteasy-reactive" and "quarkus-smallrye-reactive-messaging" are ready for Virtual-Threads execution.
Would Virtual-Threads support be coming to "quarkus-reactive-routes" soon?
Implementation ideas
No response
The text was updated successfully, but these errors were encountered: