Consider Publisher<Void> instead of Publisher<Success>

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.0.0
    • Affects Version/s: None
    • Component/s: Reactive Streams
    • None
    • None
    • Major Change
    • None
    • None
    • None
    • None
    • None
    • None

      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:

              Assignee:
              Ross Lawley
              Reporter:
              Mark Paluch
              None
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: