Repeat this observable for the given number of times or infinitely.
More...
Go to the source code of this file.
Repeat this observable for the given number of times or infinitely.
- Template Parameters
-
Count | the type of the counter (optional). |
- Parameters
-
t | The number of times the source observable items are repeated (optional). If not specified, infinitely repeats the source observable. Specifying 0 returns an empty sequence immediately |
- Returns
- An observable that repeats the sequence of items emitted by the source observable for t times.
- Sample Code\n
values.
[](int v){printf("OnNext: %d\n", v);},
[](){printf("OnCompleted\n");});
OnNext: 1
OnNext: 2
OnNext: 1
OnNext: 2
OnNext: 1
OnNext: 2
OnCompleted
If the source observable calls on_error, repeat stops:
values.
[](int v){printf("OnNext: %d\n", v);},
[](std::exception_ptr ep){
catch (const std::exception& ex) {
printf("OnError: %s\n", ex.what());
}
},
[](){printf("OnCompleted\n");});
OnNext: 1
OnNext: 2
OnError: Error
from source
◆ RXCPP_OPERATORS_RX_REPEAT_HPP
#define RXCPP_OPERATORS_RX_REPEAT_HPP |