Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refguide: Remove mention of discouraged subscribe variant #3141

Merged
merged 1 commit into from Aug 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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