Learning RxJava
Build concurrent, maintainable, and responsive Java in less time
Thomas Nield
BIRMINGHAM - MUMBAI
Learning RxJava
Copyright 2017 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: June 2017
Production reference: 1140617
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-78712-042-6
www.packtpub.com
Credits
Author
Thomas Nield | Copy Editor
Stuti Srivastava |
Reviewers David Karnok David Moten
| Project Coordinator
Prajakta Naik |
Commissioning Editor
Aaron Lazar | Proofreader
Safis Editing |
Acquisition Editor
Denim Pinto | Indexer
Tejal Daruwale Soni |
Content Development Editor
Siddhi Chavan | Graphics
Abhinash Sahu |
Technical Editor
Pranali Badge | Production Coordinator
Shraddha Falebhai |
About the Author
Thomas Nield is a business consultant for Southwest Airlines in Schedule Initiatives, and a maintainer for RxJavaFX and RxKotlin. Early in his career, he became fascinated with technology and its role in business analytics. After becoming proficient in Java, Kotlin, Python, SQL, and reactive programming, he became an open source contributor as well as an author/speaker at O'Reilly Media. He is passionate about sharing what he learns and enabling others with new skill sets. He enjoys making technical content relatable and relevant to those unfamiliar with or intimidated by it.
Currently, Thomas is interested in data science, reactive programming, and the Kotlin language. You may find him speaking on these three subjects and how they can interconnect.
He has also authored the book Getting Started with SQL, by O'Reilly Media.
Acknowledgements
I am blessed to have great people in my life who have enabled everything I do, including this book. To all my family and friends who saw little of me for 6 months while I wrote this book, thank you for being so patient and understanding.
First, I want to thank my mom and dad. They have worked hard to ensure that I have the opportunities that I have today. My dad did everything he could to provide a better education for my brothers and me. Growing up, my mom always pushed me forward, even when I resisted; she taught me to never settle and always struggle past my limits.
There are so many people at my company, Southwest Airlines, who I have to thank--the leaders and colleagues in ground ops, revenue management, and network planning, who have taken risks to green-light my projects. They have embraced my unconventional approaches in leveraging technology to solve industry challenges. It is amazing to work for a company that continues to be a maverick and support a tradition started by an attorney, a Texas businessman, and a cocktail napkin.
I also want to thank the great folks at OReilly Media and Packt who continue to open doors for me to write and speak. Although I was approached by Packt to write this book, they probably would never have found me if it was not for OReilly and my previous book, Getting Started with SQL.
While he was not involved in this book or ReactiveX, I want to extend my gratitude to Edvin Syse, the creator and maintainer of TornadoFX. I joined his project in early 2016, and it is amazing how far it has come. Edvins work has helped me save a lot of my time and enabled me to pursue initiatives like this book. If you ever need to build JVM desktop apps quickly, Edvins work may change how you do so forever. More importantly, he is probably the nicest and most helpful person you will encounter in the open source community.
Finally, I want to thank the open source community for helping me shape this journey and what ultimately became this book. David Karnok and David Moten have been enormously patient with me over the years when I had questions about RxJava. David Karnok seems to have an infinite bandwidth, not only owning and maintaining RxJava, but also answering questions and being the projects ambassador. David Moten also contributes to RxJava and is an Rx advocate for newbies and veterans alike, answering questions and helping anyone at any skill level. It is an honor to have them both review this book. I also want to thank Stepan Goncharov for checking my content on Android and everyone else in the OSS community who has been quick to share their knowledge and insights over the years.
About the Reviewers
David Karnok is the project lead and top contributor of RxJava. He is a PhD candidate in the field of production informatics. He is originally a mechanical engineer by trade who has picked up computer science along the way. He is currently a research assistant at the Engineering and Management Intelligence Research Lab under the Hungarian Academy of Sciences. He was also the first to port the historical Rx.NET library to Java back in 2011 (Reactive4Java)--2 years before Netflix started over again. Starting from late 2013, he contributed more than half of RxJava 1 and then designed, architected, and implemented almost all of RxJava 2 known today. In addition, he is perhaps the only person who does any research and development on reactive flows in terms of architecture, algorithms, and performance, of which, the major contribution to the field is the modern internals in RxJava 2 and Pivotal's Reactor Core 3. If one wants to know the in-depths of RxJava, Reactive-Streams, or reactive programming in general, David is the go-to "guru" worth listening to.
David is also a reviewer of the book, Learning Reactive Programming With Java 8, by Packt, and Reactive Programming with RxJava, by O'Reilly.
David Moten is a software developer, largely on JVM, who loves creating libraries for others and himself to use. Contributing to open source projects and participating in open source communities has been a source of enjoyment for him and a considerable education in recent years, with some really interesting complex problems in the RxJava project. RxJava itself has proven to be a huge boon, both in his workplace and outside of it, and David sees reactive programming growing in importance in mobile, backend, and frontend applications.
Next page