Skip to Content
C++ Reactive Programming
book

C++ Reactive Programming

by Praseed Pai, Peter Abraham
June 2018
Intermediate to advanced
348 pages
8h 45m
English
Packt Publishing
Content preview from C++ Reactive Programming

Hot versus Cold Observables

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(); ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Functional Programming in C++

Functional Programming in C++

Ivan Cukic

Publisher Resources

ISBN: 9781788629775Supplemental Content