Class ConnectableObservable<T>

    • Method Detail

      • connect

        public abstract void connect​(Action1<? super Subscription> connection)
        Instructs the ConnectableObservable to begin emitting the items from its underlying Observable to its Subscribers.
        Parameters:
        connection - the action that receives the connection subscription before the subscription to source happens allowing the caller to synchronously disconnect a synchronous source
        See Also:
        ReactiveX documentation: Connect
      • autoConnect

        @Beta
        public Observable<T> autoConnect()
        Returns an Observable that automatically connects to this ConnectableObservable when the first Subscriber subscribes.
        Returns:
        an Observable that automatically connects to this ConnectableObservable when the first Subscriber subscribes
        Since:
        (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
      • autoConnect

        @Beta
        public Observable<T> autoConnect​(int numberOfSubscribers)
        Returns an Observable that automatically connects to this ConnectableObservable when the specified number of Subscribers subscribe to it.
        Parameters:
        numberOfSubscribers - the number of subscribers to await before calling connect on the ConnectableObservable. A non-positive value indicates an immediate connection.
        Returns:
        an Observable that automatically connects to this ConnectableObservable when the specified number of Subscribers subscribe to it
        Since:
        (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
      • autoConnect

        @Beta
        public Observable<T> autoConnect​(int numberOfSubscribers,
                                         Action1<? super Subscription> connection)
        Returns an Observable that automatically connects to this ConnectableObservable when the specified number of Subscribers subscribe to it and calls the specified callback with the Subscription associated with the established connection.
        Parameters:
        numberOfSubscribers - the number of subscribers to await before calling connect on the ConnectableObservable. A non-positive value indicates an immediate connection.
        connection - the callback Action1 that will receive the Subscription representing the established connection
        Returns:
        an Observable that automatically connects to this ConnectableObservable when the specified number of Subscribers subscribe to it and calls the specified callback with the Subscription associated with the established connection
        Since:
        (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)