The difference to ObservablePublish is that when the upstream terminates, late observers will receive that terminal event until the connection is disposed and the ConnectableObservable is reset to its fresh state.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | ObservablePublishAlt.InnerDisposable<
the element type T>Intercepts the dispose signal from the downstream and removes itself from the connection's observers array at most once. |
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final AtomicReference | |
| pack-priv final ObservableSource |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | connect(Consumer<? super Disposable>
the action that receives the connection subscription before the subscription to source happens
allowing the caller to synchronously disconnect a synchronous source connection)Implements abstract io. ConnectableObservable to begin emitting the items from its underlying
Observable to its Observers.
|
| public void | resetIf(Disposable
the disposable received from a previous connection)connect() call.Implements io. Disposable connection instance
is still representing a connection established by a previous connect() connection.
|
| public ObservableSource | source()
Implements io. |
| protected void | subscribeActual(Observer<? super T>
the incoming Observer, never null observer)Implements abstract io. Observers.
|
| current | back to summary |
|---|---|
| pack-priv final AtomicReference<ObservablePublishAlt. | |
| source | back to summary |
|---|---|
| pack-priv final ObservableSource<T> source | |
| ObservablePublishAlt | back to summary |
|---|---|
| public ObservablePublishAlt(ObservableSource<T> source) | |
| connect | back to summary |
|---|---|
| public void connect(Consumer<? super Disposable> connection) Implements abstract io. Doc from io. Instructs the
| |
| resetIf | back to summary |
|---|---|
| public void resetIf(Disposable connection) Implements io. Doc from io. Reset the connectable source only if the given For example, an immediately previous connection should reset the connectable source:
However, if the connection indicator Disposable is from a much earlier connection,
it should not affect the current connection:
| |
| source | back to summary |
|---|---|
| public ObservableSource Implements io. Doc from io. Returns the upstream source of this Observable. Allows discovering the chain of observables.
| |
| subscribeActual | back to summary |
|---|---|
| protected void subscribeActual(Observer<? super T> observer) Implements abstract io. Doc from io. Operator implementations (both source and intermediate) should implement this method that
performs the necessary business logic and handles the incoming There is no need to call any of the plugin hooks on the current | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final Observer | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | dispose()
Implements io. |
| public boolean | isDisposed()
Implements io. |
| downstream | back to summary |
|---|---|
| pack-priv final Observer<? super T> downstream | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. | |
| InnerDisposable | back to summary |
|---|---|
| pack-priv InnerDisposable(Observer<? super T> downstream, ObservablePublishAlt. | |
| dispose | back to summary |
|---|---|
| public void dispose() Implements io. Doc from io. Dispose the resource, the operation should be idempotent.
| |
| isDisposed | back to summary |
|---|---|
| public boolean isDisposed() Implements io. Doc from io. Returns true if this resource has been disposed.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final AtomicBoolean | |
| pack-priv final AtomicReference | |
| pack-priv static final ObservablePublishAlt. | |
| pack-priv Throwable | |
| private static final long | |
| pack-priv static final ObservablePublishAlt. | |
| pack-priv final AtomicReference |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public void | dispose()
Implements io. |
| public boolean | isDisposed()
Implements io. |
| public void | onComplete()
Implements io. Observable has finished sending push-based notifications.
|
| public void | onError(Throwable
the exception encountered by the Observable e)Implements io. Observable has experienced an error condition.
|
| public void | onNext(T
the item emitted by the Observable t)Implements io. |
| public void | onSubscribe(Disposable
the Disposable instance whose d)Disposable#dispose() can
be called anytime to cancel the connectionImplements io. onNext(Object)) and asynchronous manner.
|
| public void |
| connect | back to summary |
|---|---|
| pack-priv final AtomicBoolean connect | |
| current | back to summary |
|---|---|
| pack-priv final AtomicReference<ObservablePublishAlt. | |
| EMPTY | back to summary |
|---|---|
pack-priv static final ObservablePublishAlt.
| |
| error | back to summary |
|---|---|
| pack-priv Throwable error | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. | |
| TERMINATED | back to summary |
|---|---|
pack-priv static final ObservablePublishAlt.
| |
| upstream | back to summary |
|---|---|
| pack-priv final AtomicReference<Disposable> upstream | |
| PublishConnection | back to summary |
|---|---|
pack-priv PublishConnection(AtomicReference<ObservablePublishAlt.
| |
| add | back to summary |
|---|---|
| public boolean add(ObservablePublishAlt. | |
| dispose | back to summary |
|---|---|
| public void dispose() Implements io. Doc from io. Dispose the resource, the operation should be idempotent.
| |
| isDisposed | back to summary |
|---|---|
| public boolean isDisposed() Implements io. Doc from io. Returns true if this resource has been disposed.
| |
| onComplete | back to summary |
|---|---|
| public void onComplete() Implements io. Doc from io. Notifies the Observer that the
The
| |
| onError | back to summary |
|---|---|
| public void onError(Throwable e) Implements io. Doc from io. Notifies the Observer that the
If the
| |
| onNext | back to summary |
|---|---|
| public void onNext(T t) Implements io. Doc from io. Provides the Observer with a new item to observe.
The
The
| |
| onSubscribe | back to summary |
|---|---|
| public void onSubscribe(Disposable d) Implements io. Doc from io. Provides the Observer with the means of cancelling (disposing) the
connection (channel) with the Observable in both
synchronous (from within
| |
| remove | back to summary |
|---|---|
public void remove(ObservablePublishAlt.
| |