Skip to content
Advertisement

Tag: reactive-programming

How to convert List into a Mono

i’m trying to convert this method to an a reactive method I Have something like this but i don’t know how to conver the ArrayList to return an Mono<List> Answer If you really want a Mono, then just wrap the value that you want to transport in it: But I doubt you really want to return a list in a

Process List with synchronous delay after flatMap?

Hey I just started to dive into reactive programming and I can’t figure out how to process a List<String> in a synchronous way after flatMap. What I am trying to achieve: Get domain list from external service Filter out existing domains in database Make another http request to external service to get domain info. These calls should be executed in

Building a Recursive Data Structure with Spring WebFlux

I have a REST API that is built with the Spring WebFlux framework, and I have an endpoint which returns a Flux<ChannelResponse>, where ChannelResponse is a tree-structured object, as shown below: Now, I don’t have much experience with the reactive programming paradigm, but this is how I would implement such an endpoint with synchronous logic, such that each top-level channel

Cold streams and publishers, is the Garbage Collector fully aware of its true death?

When instanceSubscriptorManager is unable to receive any more boolean values, the last thing to be performed will be a false as isActive, removing localConsumer from publisher. How is localConsumer “aware” that instanceSubscriptorManager will be unable to receive an isActive -> true (again) sometime in the future, especially since the class is self-referencing itself? In short, this class is hold by

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

Uni.combine().all().unis() v.s. Multi..onItem().transformToMultiAndConcatenate().collect()

In my Quarkus service, I need to fetch a list of results from external service, and I figured out there are two methods to achieve the same goal: 1st approach based on Uni.combine().all(): 2nd approach based on Multi..onItem().transformToMultiAndConcatenate().collect() In the beginning I don’t think there exists any true difference between the two approaches, as Uni are evaluated lazily and either

Advertisement