Replies: 1 comment 8 replies
-
@micronaut-projects/core-developers thoughts? |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
While reviewing #382, I have suggested rewriting a controller return a RxJava 2 type such as:
As:
@graeme commented out:
RxJava2 code in guides needs migrated for Micronaut 3. The previous snippet with
Single
will not work in a Micronaut 3 application out of the Box.If the user does not want to change the code, they need to add:
io.micronaut.rxjava2:micronaut-rxjava2
.However, we suggest the users to move to Project Reactor
Thus, at least we should rewrite the code as: \
For the above code, we will need to tell the user to add:
io.micronaut.reactor:micronaut-reactor
or
io.projectreactor:reactor-core
What I suggest is to use:
Moreover, for simple reactive code (e.g. usage of
just
) we could use Micronaut's Publishers` own class. With the benefit that the user does not need to even add a reactive library dependency.I think in public methods, we should do encourage users to use
Publisher
or@SingleResult Publisher
or reactive streams with a single emitted item.@SingleResult
does and the pattern of not exposing a reactive implementation in our code base.Beta Was this translation helpful? Give feedback.
All reactions