public interface ResettableConnectable
ConnectableObservable
s
and ConnectableFlowable
s.Modifier and Type | Method and Description |
---|---|
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. |
void resetIf(Disposable connection)
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());
connection
- the disposable received from a previous connect()
call.Copyright © 2019. All rights reserved.