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

Observables

In the previous chapter, we created Observables from the  scratch and  subscribed to those Observables. In all of our examples, the Observables created an instance of the  (data)  Producer class. The Producer class produces an event Stream. In other words, Observables are functions that connect Subscribers (Observers) to Producers.

Before we proceed, let's dissect an Observable and the core activities related to it:

  • An Observable is a function that takes an Observer as a parameter and returns a function
  • An Observable connects an Observer to a Producer (Producer is opaque to the Observer)
  • A Producer is a source of values for an Observable
  • An Observer is an object that has the on_next, on_error, and on_completed methods
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