June 2018
Intermediate to advanced
348 pages
8h 45m
English
In most examples in the previous chapter, we saw that Producers were created in Observable functions. A Producer can also be created outside an Observable function, and a reference to the Producer can be put inside the Observable function. An Observable that refers to a Producer which was created outside its scope is called a hot Observable. Any Observable where we created a Producer instance inside (an Observable) is called a cold Observable. To make matters clear, let's write a program to demonstrate a cold Observable:
//---------- ColdObservable.cpp
#include <rxcpp/rx.hpp>
#include <memory>
int main(int argc, char *argv[])
{ //----------- Get a Coordination auto eventloop = rxcpp::observe_on_event_loop(); ...