Summary
In this chapter, we looked in more depth at how to use disposables and operators, how these work internally, and what it means for us. We also saw how to use Observable::create()
and Observable::defer()
to create new Observables with custom logic.
The app that we have built was meant to be a simple Reddit reader that combines all the aspects of RxPHP we've learned so far. We also saw how we can achieve a truly responsive app by making all long running tasks non-blocking. We used Symfony Console component to handle user input and output from terminal. Also, we used Symfony Process component to easily spawn and have control over subprocesses.
We also looked at a couple of new classes from RxPHP, such as ConnectableObservable
, CompositeDisposable
, or takeWhile()
operator.
In the following chapter, we'll work with some event-based systems used in popular PHP frameworks, such as Symfony, Silex, and Zend Framework, and see how we can combine them with the principles of reactive programming...