Turn a cold observable hot and allow connections to the source to be independent of subscriptions. Turn a cold observable hot, send the most recent value to any new subscriber, and allow connections to the source to be independent of subscriptions.
More...
Go to the source code of this file.
|
template<class... AN> |
auto | rxcpp::operators::publish (AN &&...an) -> operator_factory< publish_tag, AN... > |
| Turn a cold observable hot and allow connections to the source to be independent of subscriptions. Turn a cold observable hot, send the most recent value to any new subscriber, and allow connections to the source to be independent of subscriptions. More...
|
|
template<class... AN> |
auto | rxcpp::operators::publish_synchronized (AN &&...an) -> operator_factory< publish_synchronized_tag, AN... > |
| Turn a cold observable hot and allow connections to the source to be independent of subscriptions. More...
|
|
Turn a cold observable hot and allow connections to the source to be independent of subscriptions. Turn a cold observable hot, send the most recent value to any new subscriber, and allow connections to the source to be independent of subscriptions.
- Template Parameters
-
T | the type of the emitted item (optional). |
- Parameters
-
first | an initial item to be emitted by the resulting observable at connection time before emitting the items from the source observable; not emitted to observers that subscribe after the time of connection (optional). |
cs | the subscription to control lifetime (optional). |
- Returns
- rxcpp::connectable_observable that upon connection causes the source observable to emit items to its observers.
- Sample Code
[](long v){printf("[1] OnNext: %ld\n", v);},
[](){printf("[1] OnCompleted\n");});
[](long v){printf("[2] OnNext: %ld\n", v);},
[](){printf("[2] OnCompleted\n");});
values.connect();
[](long v){printf("[3] OnNext: %ld\n", v);},
[](){printf("[3] OnCompleted\n");});
});
[1] OnNext: 1
[2] OnNext: 1
[1] OnNext: 2
[2] OnNext: 2
[1] OnNext: 3
[2] OnNext: 3
[3] OnNext: 3
[1] OnNext: 4
[2] OnNext: 4
[3] OnNext: 4
[1] OnNext: 5
[2] OnNext: 5
[3] OnNext: 5
[1] OnCompleted
[2] OnCompleted
[3] OnCompleted
- Sample Code
[](long v){printf("[1] OnNext: %ld\n", v);},
[](){printf("[1] OnCompleted\n");});
[](long v){printf("[2] OnNext: %ld\n", v);},
[](){printf("[2] OnCompleted\n");});
values.connect();
[](long v){printf("[3] OnNext: %ld\n", v);},
[](){printf("[3] OnCompleted\n");});
});
[1] OnNext: 0
[2] OnNext: 0
[1] OnNext: 1
[2] OnNext: 1
[1] OnNext: 2
[2] OnNext: 2
[3] OnNext: 2
[1] OnNext: 3
[2] OnNext: 3
[3] OnNext: 3
[1] OnNext: 4
[2] OnNext: 4
[3] OnNext: 4
[1] OnNext: 5
[2] OnNext: 5
[3] OnNext: 5
[1] OnCompleted
[2] OnCompleted
[3] OnCompleted
#define RXCPP_OPERATORS_RX_PUBLISH_HPP |