Skip to content
Advertisement

Tag: reactor

Problem of type inference and type variance for Reactor/WebFlux

Let’s say there is an interface and its implement class as: And then, for the method Mono<InterfaceA> getMonoA(), the following implementation causes a compile error: It makes sense that the invariance type Mono<InterfaceA> is not the super class of Mono<ClassA> even if InterfaceA is the super class of ClassA and therefore the return type of ClassA.getMonoA() which is Mono<ClassA> does

How to chain reactive calls correctly and sequentially

I am trying to make calls with the following order: save an object publish an object creation event, only if the first step is done Return a Flux list What I have currently is following: Would this work and publish event as requested, or should I use zipWhen() instead of doOnSuccess()? Answer doOn… are so-called side-effect operators and should not

Reactive – Improve Mono syntax

I have this block of code that works fine: To summarize it: calls the isBlacklistedToken function (returns a Mono<Boolean> with the result of the refresh token) If the refresh token is blacklisted, throws an UnauthorizedException If the refresh token is not blacklisted, does the same process for the access token If both tokens are not blacklisted, finally blacklists them. This

what’s the meaning of server.onDispose().block()?

There are few web pages about reactor-netty on the internet. And I don’t understand the meaning of some code below. These code below is just ABC of reactor-netty. But I really can not find more information on the internet. So I have to ask for help. Please help me with the five places in the code above. Thank you. Answer

Smart way to handle nested flux operations

I have 2 query methods (findByName/findAnotherName) . Both of them return Mono<List> . I do some logic by compare results of these two methods, and then return one of them in a nested Flux operation. It may have a smart way to achieve same result though. Following is code snippet: Thanks in advance. Answer https://projectreactor.io/docs/core/release/api/reactor/core/publisher/Mono.html#zipWhen-java.util.function.Function-java.util.function.BiFunction- If your //do some logic

Advertisement