June 2017
Beginner to intermediate
274 pages
6h 49m
English
Arguably, the single most fundamental element of a reactive programming system is the observer interface. The definition of how we can notify an object that the next item in a sequence is watching it is available. What we're starting with in the following code example is an abstract base class, the closest Python equivalent to a C# interface:

Our Observer class doesn't define any functionality at all, just method names and signatures, and guarantees that classes which inherit from it will have to implement at least the on_event method. For a complete functionality, they'd have to implement on_exception and on_complete as well, but ...
Read now
Unlock full access