inspect calls to on_next, on_error and on_completed.
More...
Go to the source code of this file.
inspect calls to on_next, on_error and on_completed.
- Template Parameters
-
MakeObserverArgN... | these args are passed to make_observer. |
- Parameters
-
an | these args are passed to make_observer. |
- Returns
- Observable that emits the same items as the source observable to both the subscriber and the observer.
- Note
- If an on_error method is not supplied the observer will ignore errors rather than call std::terminate()
- Sample Code\n
[](int v){printf("Tap - OnNext: %d\n", v);},
[](){printf("Tap - OnCompleted\n");});
values.
[](int v){printf("Subscribe - OnNext: %d\n", v);},
[](){printf("Subscribe - OnCompleted\n");});
Tap - OnNext: 1
Subscribe - OnNext: 1
Tap - OnNext: 2
Subscribe - OnNext: 2
Tap - OnNext: 3
Subscribe - OnNext: 3
Tap - OnCompleted
Subscribe - OnCompleted
If the source observable generates an error, the observer passed to tap is called:
[](int v){printf("Tap - OnNext: %d\n", v);},
[](std::exception_ptr ep){
printf(
"Tap - OnError: %s\n",
rxu::what(ep).c_str());
},
[](){printf("Tap - OnCompleted\n");});
values.
[](int v){printf("Subscribe - OnNext: %d\n", v);},
[](std::exception_ptr ep){
printf(
"Subscribe - OnError: %s\n",
rxu::what(ep).c_str());
},
[](){printf("Subscribe - OnCompleted\n");});
Tap - OnNext: 1
Subscribe - OnNext: 1
Tap - OnNext: 2
Subscribe - OnNext: 2
Tap - OnNext: 3
Subscribe - OnNext: 3
Tap - OnError: Error
from source
Subscribe - OnError: Error
from source
◆ RXCPP_OPERATORS_RX_TAP_HPP
#define RXCPP_OPERATORS_RX_TAP_HPP |
auto range(T first=0, T last=std::numeric_limits< T >::max(), std::ptrdiff_t step=1) -> observable< T, detail::range< T, identity_one_worker >>
Definition: rx-range.hpp:119