Quantcast
Channel: Active questions tagged redis+java - Stack Overflow
Viewing all articles
Browse latest Browse all 2222

Non blocking way to return a mono response value

$
0
0

I have below code, what is the ideal way to return the value correctly from this method that uses reactive redis operations and is meant to serve as an common api to read a value from redis. I can write some whacky code to manage this but just wondering if there is a cool way that I may be missing, thanks for sharing.

public Object getObject(final String key, final String hash) {          reactiveRedisCommands.hget(key , field ) //returns Mono<String>         .subscribe(                         new Consumer<String>() {                @Override                public void accept(String value) {                    //String value  is obtained here and converted to object as per type and any additional processing that is required                                 }            });     return null;// how to return correct value here}   

Viewing all articles
Browse latest Browse all 2222

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>