Top Description Methods
io.reactivex.internal.disposables

public Interface ResettableConnectable

Known Direct Implementers
io.reactivex.internal.operators.flowable.FlowableReplay, io.reactivex.internal.operators.flowable.FlowablePublishAlt, io.reactivex.internal.operators.observable.ObservableReplay, io.reactivex.internal.operators.observable.ObservablePublishAlt
Annotations
@Experimental
Imports
io.reactivex.annotations.Experimental, io.reactivex.disposables.Disposable, io.reactivex.flowables.ConnectableFlowable, io.reactivex.observables.ConnectableObservable

Interface allowing conditional resetting of connections in ConnectableObservables and ConnectableFlowables.
Since
2.2.2 - experimental

Method Summary

Modifier and TypeMethod and Description
public void
resetIf(Disposable
the disposable received from a previous connect() call.
connection
)

Reset the connectable source only if the given Disposable connection instance is still representing a connection established by a previous connect() connection.

Method Detail

resetIfback to summary
public void resetIf(Disposable connection)

Reset the connectable source only if the given Disposable connection instance is still representing a connection established by a previous connect() connection.

For example, an immediately previous connection should reset the connectable source:


Disposable d = connectable.connect();

((ResettableConnectable)connectable).resetIf(d);
However, if the connection indicator Disposable is from a much earlier connection, it should not affect the current connection:

Disposable d1 = connectable.connect();
d.dispose();

Disposable d2 = connectable.connect();

((ResettableConnectable)connectable).resetIf(d);

assertFalse(d2.isDisposed());
Parameters
connection:Disposable

the disposable received from a previous connect() call.