From be2b3795ea904202fda4384aadb6d54aa70191d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Basl=C3=A9?= Date: Mon, 8 Aug 2022 18:43:38 +0200 Subject: [PATCH] Refguide: Remove mention of discouraged subscribe variant (#3141) This commit removes the mention of the subscribe variant that takes a Consumer from the reference guide. This method is deprecated in order to discourage it, as it is easy to misuse it and cause hanging when no request is explicitly made by the Consumer. Fixes #3090. --- docs/asciidoc/subscribe-details.adoc | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/docs/asciidoc/subscribe-details.adoc b/docs/asciidoc/subscribe-details.adoc index 3c01844acd..7cd9889e91 100644 --- a/docs/asciidoc/subscribe-details.adoc +++ b/docs/asciidoc/subscribe-details.adoc @@ -106,26 +106,6 @@ Done ---- ==== -The last signature of the `subscribe` method includes a `Consumer`. - -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 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.