Using the reactive extensions for Python (RxPY)
Now that we have a basic understanding of reactive programming under our belts, let's look at one of the more widely used reactive programming frameworks called Reactive Extensions, which is often shortened to ReactiveX, or simply Rx.
Rx is not part of a standard Python installation, so we'll need to use pip
to install it. No problem; it's only a single command, if you prefer to install to your Python system library instead of user library, or you are working in a virtual created by the --user
from this command, as shown here:

Once we have Rx installed, we can move on to the fun stuff.
Translating our zoo demo into Rx
Like our example in the previous section, Rx provides Observer
and Observable
classes, and they encompass the same basic functionality.
The largest visible difference is that the Observable
class of Rx has a large number of factory methods that could be used to construct special-purpose observables, especially, observables that produce...