lettuce icon indicating copy to clipboard operation
lettuce copied to clipboard

Mono returned by RedisPubSubReactiveCommands#subscribe does not return result

Open ywtsang opened this issue 8 years ago • 1 comments

Lettuce version: 5.0.1.RELEASE

I check the result of the Mono returned by RedisPubSubReactiveCommands#subscribe , it does not return any result even the subscribe operation is successful. This looks like it is different from the javadoc.

So I cannot use flatMap to chain the next operation unless I add switchIfEmpty to return an "dummy" value for the Mono to proceed.

ywtsang avatar Mar 01 '18 05:03 ywtsang

Good catch. The documentation was wrong and reflected the state of the previous RxJava implementation. A SUBSCRIBE Mono<Void> completes without emitting a result. If you want to chain the call, continue with Publisher via switchIfEmpty(…) that carries the sequence which should happen once SUBSCRIBE is completed.

mp911de avatar Mar 01 '18 14:03 mp911de