Beginner question - When to return Uni from resource and when to not? #42953
Unanswered
cheetyrooroo
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Thanks for the nice framework. When I started playing with it I just returned normal data types from my resources. But I realised after reading the docs that you can return a Uni and make the request run on the event loop thread (plz correct me if I'm wrong) which sounds like it will be more efficient when more requests come.
But we should also not do anything heavy on the event loop thread.
So as example if I have a resource that will
If I want to squeeze the most performance out of Quarkus:
Should I be making my resource return a Uni?
Should I make the rest client method return a Uni? (Looks like it already runs on event loop without it?)
Should I use Hibernate reactive?
What's some cases where I shouldn't return a Uni ever? Just little confused 😊
Beta Was this translation helpful? Give feedback.
All reactions