The existing connectable_observable.ref_count() operator calls
connect on the source when it's subscribed to.
Generalize this by allowing an optional parameter other, i.e.
observable.ref_count(connectable_observable other) to be used as the
connect target.
Useful for implementing diamond graphs while retaining composability:
A
/ \
B C
\ /
D
|
E
auto A = ... | publish();
auto B = A | ...;
auto C = A | ...;
auto D = B | merge(C) | ref_count(A);
auto E = D | ...;
E | subscribe(...);
The existing
connectable_observable.ref_count()
operator calls connect on the source when it's subscribed to.Generalize this by allowing an optional parameter
other
, i.e.observable.ref_count(connectable_observable other)
to be used as the connect target.Useful for implementing diamond graphs while retaining composability:
Resolves: https://github.com/ReactiveX/RxCpp/issues/484