From the course: Functional Programming in C++

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Coroutine with RxCpp and ranges

Coroutine with RxCpp and ranges - C++ Tutorial

From the course: Functional Programming in C++

Coroutine with RxCpp and ranges

- [Instructor] Modern C++20 introduces coroutines and ranges, making building lazy asynchronous pipelines easier. Coroutines function to suspend and resume execution, while ranges simplify the processing of collections. By integrating RxCPP with coroutines and ranges, we can create efficient Reactive workflows. So here, I'm just in some code, and we're going to kind of start from scratch right here. And we're going to begin by creating an RxCPP observable, so rxcpp:: observable. It is of type [Interviewer], and we're going to call this observable generate_values. And all it's going to do here is we're going to have a return statement, and then we're going to define rxcpp::observable<>::create, rxcpp::observable<>::create And to this function we are going to pass, you guessed it, a Lambda. And inside of here we're going to pass a subscriber, which is of type rxcpp::subscriber<int> and we're going to call it subscriber. And next we're going to have a for loop, which is going to be a…

Contents