I am writing a web server with extensive usage of reactive programming. I noticed that I forgot to check if Mono is empty too many times. I am using WebFlux, so it converts an empty Mono to a 200 OK response, and it makes it very hard to detect these errors.
One way of reducing these mistakes is to make absence of a value explicit by using Mono> instead of Mono.empty().
This feels very similar to Optional and null debate, it even uses the same class. And while there are many people that are in favour of using Optional and it is widely supported by libraries, I've yet to see anyone using Mono>.
Are there any drawbacks of using Mono>?
What is a better way to reliably handle cases of absent values?
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)