Search in sources :

Example 1 with ConnectConsumer

use of io.reactivex.rxjava3.internal.util.ConnectConsumer in project RxJava by ReactiveX.

the class ConnectableFlowable method connect.

/**
 * Instructs the {@code ConnectableFlowable} to begin emitting the items from its underlying
 * {@link Flowable} to its {@link Subscriber}s.
 * <p>
 * To disconnect from a synchronous source, use the {@link #connect(io.reactivex.rxjava3.functions.Consumer)} method.
 * <dl>
 *  <dt><b>Scheduler:</b></dt>
 *  <dd>The behavior is determined by the implementor of this abstract class.</dd>
 * </dl>
 *
 * @return the subscription representing the connection
 * @see <a href="http://reactivex.io/documentation/operators/connect.html">ReactiveX documentation: Connect</a>
 */
@NonNull
@SchedulerSupport(SchedulerSupport.NONE)
public final Disposable connect() {
    ConnectConsumer cc = new ConnectConsumer();
    connect(cc);
    return cc.disposable;
}
Also used : ConnectConsumer(io.reactivex.rxjava3.internal.util.ConnectConsumer)

Example 2 with ConnectConsumer

use of io.reactivex.rxjava3.internal.util.ConnectConsumer in project RxJava by ReactiveX.

the class ConnectableObservable method connect.

/**
 * Instructs the {@code ConnectableObservable} to begin emitting the items from its underlying
 * {@link Observable} to its {@link Observer}s.
 * <p>
 * To disconnect from a synchronous source, use the {@link #connect(Consumer)} method.
 * <dl>
 *  <dt><b>Scheduler:</b></dt>
 *  <dd>The behavior is determined by the implementor of this abstract class.</dd>
 * </dl>
 *
 * @return the {@link Disposable} representing the connection
 * @see <a href="http://reactivex.io/documentation/operators/connect.html">ReactiveX documentation: Connect</a>
 */
@NonNull
@SchedulerSupport(SchedulerSupport.NONE)
public final Disposable connect() {
    ConnectConsumer cc = new ConnectConsumer();
    connect(cc);
    return cc.disposable;
}
Also used : ConnectConsumer(io.reactivex.rxjava3.internal.util.ConnectConsumer)

Aggregations

ConnectConsumer (io.reactivex.rxjava3.internal.util.ConnectConsumer)2