Skip to content

Commit

Permalink
Merge #3141 into 3.5.0-M5
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbasle committed Aug 8, 2022
2 parents e5eeeb9 + be2b379 commit 478cc4e
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions docs/asciidoc/subscribe-details.adoc
Expand Up @@ -106,26 +106,6 @@ Done
----
====

The last signature of the `subscribe` method includes a `Consumer<Subscription>`.

NOTE: That variant requires you to do something with the `Subscription` (perform a
`request(long)` on it or `cancel()` it). Otherwise the `Flux` hangs.

The following example shows the last signature of the `subscribe` method:

====
[source,java]
----
Flux<Integer> ints = Flux.range(1, 4);
ints.subscribe(i -> System.out.println(i),
error -> System.err.println("Error " + error),
() -> System.out.println("Done"),
sub -> sub.request(10)); <1>
----
<1> When we subscribe we receive a `Subscription`. Signal that we want up to `10`
elements from the source (which will actually emit 4 elements and complete).
====

=== Cancelling a `subscribe()` with Its `Disposable`

All these lambda-based variants of `subscribe()` have a `Disposable` return type.
Expand Down

0 comments on commit 478cc4e

Please sign in to comment.