-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Reactive Streams
-
None
-
Major Change
MongoDB driver returns Publisher<Success> for operations that do not return a value and which would be represented with void in an imperative API.
Reactive API's are inherently event-oriented (onNext|onComplete|onError signals) and do not require emission of a placeholder data element to signal successful completion. A successful termination without emitting an element would be the idiomatic approach for a Reactive Streams API. Each composition library has its own strategy how to represent the absence of elements/completion:
- Project Reactor: Mono<Void>
- RxJava 2: Completable type (manifestation via type system)
- Akka Streams: CompletableFuture<Done> (using Java 8's type and Done to prevent null)
It would be great if a future version of the Reactive Streams driver would adapt to Publisher<Void>.
Reference:
- related to
-
JAVA-4303 Improve map/flatmap of Publisher[Void]
- Closed