11package reactor .core .scala .publisher
22
3- import reactor .core .publisher .{ConnectableFlux => JConnectableFlux }
43import reactor .core .Disposable
4+ import reactor .core .publisher .ConnectableFlux
55import reactor .core .scheduler .Scheduler
66
77import scala .concurrent .duration .Duration
88
9- class ConnectableFlux [T ]private (private val jConnectableFlux : JConnectableFlux [T ]) extends SFlux [T ] {
9+ class ConnectableSFlux [T ]private (private val connectableFlux : ConnectableFlux [T ]) extends SFlux [T ] {
1010
1111 /**
12- * Connects this [[ConnectableFlux ]] to the upstream source when the first [[org.reactivestreams.Subscriber ]]
12+ * Connects this [[ConnectableSFlux ]] to the upstream source when the first [[org.reactivestreams.Subscriber ]]
1313 * subscribes.
1414 *
1515 * <p>
1616 * <img class="marble" src="https://raw.githubusercontent.com/reactor/reactor-core/v3.0.6.RELEASE/src/docs/marble/autoconnect.png" alt="">
1717 *
1818 * @return a [[SFlux ]] that connects to the upstream source when the first [[org.reactivestreams.Subscriber ]] subscribes
1919 */
20- final def autoConnect (): SFlux [T ] = SFlux .fromPublisher(jConnectableFlux .autoConnect())
20+ final def autoConnect (): SFlux [T ] = SFlux .fromPublisher(connectableFlux .autoConnect())
2121
2222 /**
23- * Connects this [[ConnectableFlux ]] to the upstream source when the specified amount of
23+ * Connects this [[ConnectableSFlux ]] to the upstream source when the specified amount of
2424 * [[org.reactivestreams.Subscriber ]] subscribes.
2525 * <p>
2626 * Subscribing and immediately unsubscribing Subscribers also contribute the the subscription count
@@ -32,10 +32,10 @@ class ConnectableFlux[T]private (private val jConnectableFlux: JConnectableFlux[
3232 * @param minSubscribers the minimum number of subscribers
3333 * @return a [[SFlux ]] that connects to the upstream source when the given amount of Subscribers subscribe
3434 */
35- final def autoConnect (minSubscribers : Int ): SFlux [T ] = SFlux .fromPublisher(jConnectableFlux .autoConnect(minSubscribers))
35+ final def autoConnect (minSubscribers : Int ): SFlux [T ] = SFlux .fromPublisher(connectableFlux .autoConnect(minSubscribers))
3636
3737 /**
38- * Connects this [[ConnectableFlux ]] to the upstream source when the specified amount of
38+ * Connects this [[ConnectableSFlux ]] to the upstream source when the specified amount of
3939 * [[org.reactivestreams.Subscriber ]] subscribes and calls the supplied consumer with a runnable that allows disconnecting.
4040 *
4141 * @param minSubscribers the minimum number of subscribers
@@ -45,18 +45,18 @@ class ConnectableFlux[T]private (private val jConnectableFlux: JConnectableFlux[
4545 * <img class="marble" src="https://raw.githubusercontent.com/reactor/reactor-core/v3.0.6.RELEASE/src/docs/marble/autoconnect.png" alt="">
4646 * @return a { @link Flux} that connects to the upstream source when the given amount of subscribers subscribed
4747 */
48- final def autoConnect (minSubscribers : Int , cancelSupport : Disposable => Unit ): SFlux [T ] = SFlux .fromPublisher(jConnectableFlux .autoConnect(minSubscribers, cancelSupport))
48+ final def autoConnect (minSubscribers : Int , cancelSupport : Disposable => Unit ): SFlux [T ] = SFlux .fromPublisher(connectableFlux .autoConnect(minSubscribers, cancelSupport))
4949
5050 /**
51- * Connect this [[ConnectableFlux ]] to its source and return a [[Runnable ]] that
51+ * Connect this [[ConnectableSFlux ]] to its source and return a [[Runnable ]] that
5252 * can be used for disconnecting.
5353 *
5454 * @return the [[Disposable ]] that allows disconnecting the connection after.
5555 */
56- final def connect (): Disposable = jConnectableFlux .connect()
56+ final def connect (): Disposable = connectableFlux .connect()
5757
5858 /**
59- * Connects this [[ConnectableFlux ]] to its source and sends a [[Disposable ]] to a callback that
59+ * Connects this [[ConnectableSFlux ]] to its source and sends a [[Disposable ]] to a callback that
6060 * can be used for disconnecting.
6161 *
6262 * <p>The call should be idempotent in respect of connecting the first
@@ -66,7 +66,7 @@ class ConnectableFlux[T]private (private val jConnectableFlux: JConnectableFlux[
6666 * @param cancelSupport the callback is called with a Cancellation instance that can
6767 * be called to disconnect the source, even synchronously.
6868 */
69- final def connect (cancelSupport : Disposable => Unit ): Unit = jConnectableFlux .connect(cancelSupport)
69+ final def connect (cancelSupport : Disposable => Unit ): Unit = connectableFlux .connect(cancelSupport)
7070
7171 /**
7272 * Connects to the upstream source when the first [[org.reactivestreams.Subscriber ]] subscribes and disconnects
@@ -77,7 +77,7 @@ class ConnectableFlux[T]private (private val jConnectableFlux: JConnectableFlux[
7777 *
7878 * @return a reference counting [[SFlux ]]
7979 */
80- final def refCount (): SFlux [T ] = SFlux .fromPublisher(jConnectableFlux .refCount())
80+ final def refCount (): SFlux [T ] = SFlux .fromPublisher(connectableFlux .refCount())
8181
8282 /**
8383 * Connects to the upstream source when the given number of [[org.reactivestreams.Subscriber ]] subscribes and disconnects
@@ -89,7 +89,7 @@ class ConnectableFlux[T]private (private val jConnectableFlux: JConnectableFlux[
8989 * @param minSubscribers the number of subscribers expected to subscribe before connection
9090 * @return a reference counting [[SFlux ]]
9191 */
92- final def refCount (minSubscribers : Int ): SFlux [T ] = SFlux .fromPublisher(jConnectableFlux .refCount(minSubscribers))
92+ final def refCount (minSubscribers : Int ): SFlux [T ] = SFlux .fromPublisher(connectableFlux .refCount(minSubscribers))
9393
9494 /**
9595 * Connects to the upstream source when the given number of [[org.reactivestreams.Subscriber ]] subscribes.
@@ -106,7 +106,7 @@ class ConnectableFlux[T]private (private val jConnectableFlux: JConnectableFlux[
106106 * disconnecting when all subscribers have cancelled.
107107 * @return a reference counting [[SFlux ]] with a grace period for disconnection
108108 */
109- final def refCount (minSubscribers : Int , gracePeriod : Duration ): SFlux [T ] = SFlux .fromPublisher(jConnectableFlux .refCount(minSubscribers, gracePeriod))
109+ final def refCount (minSubscribers : Int , gracePeriod : Duration ): SFlux [T ] = SFlux .fromPublisher(connectableFlux .refCount(minSubscribers, gracePeriod))
110110
111111 /**
112112 * Connects to the upstream source when the given number of [[org.reactivestreams.Subscriber ]] subscribes.
@@ -124,11 +124,11 @@ class ConnectableFlux[T]private (private val jConnectableFlux: JConnectableFlux[
124124 * @param scheduler the [[Scheduler ]] on which to run timeouts
125125 * @return a reference counting [[SFlux ]] with a grace period for disconnection
126126 */
127- final def refCount (minSubscribers : Int , gracePeriod : Duration , scheduler : Scheduler ): SFlux [T ] = SFlux .fromPublisher(jConnectableFlux .refCount(minSubscribers, gracePeriod, scheduler))
127+ final def refCount (minSubscribers : Int , gracePeriod : Duration , scheduler : Scheduler ): SFlux [T ] = SFlux .fromPublisher(connectableFlux .refCount(minSubscribers, gracePeriod, scheduler))
128128
129- override private [publisher] def coreFlux : JConnectableFlux [T ] = jConnectableFlux
129+ override private [publisher] def coreFlux : ConnectableFlux [T ] = connectableFlux
130130}
131131
132- object ConnectableFlux {
133- def apply [T ](jConnectableFlux : JConnectableFlux [T ]) = new ConnectableFlux [T ](jConnectableFlux)
132+ object ConnectableSFlux {
133+ def apply [T ](jConnectableFlux : ConnectableFlux [T ]) = new ConnectableSFlux [T ](jConnectableFlux)
134134}
0 commit comments