So I want to create a Mono<Void>
(or any Mono<SomeIgnorableType>
) that actually emits an element.
Why? Because I actually want to run an effect, and the result just implies the effect was run, YET, it can be ignored.
In Haskell Void is an uninhabitable type... like the Nothing
in Scala. In Java Void is also uninhabitable, yet it is used more like the Unit
type in Scala or the ()
(0 arity tuple) in Haskell. A type with only one inhabitant.
Ok, too much with the theory. My options so far:
Mono.just((Void) null)
throws an Exception.Mono.empty().single()
(because I actually want to emit an event), ends up with failure, when one subscribes to it. And...Mono.just("something").then()
runs the effect, but then I cannot chain it with other monos, because it only emits complete and error events.
So how???
Mono<Tuple0>
(Tuple0
from Vavr). – Neisa