Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Reactive Programming in Kotlin

You're reading from   Reactive Programming in Kotlin Design and build non-blocking, asynchronous Kotlin applications with RXKotlin, Reactor-Kotlin, Android, and Spring

Arrow left icon
Product type Paperback
Published in Dec 2017
Publisher Packt
ISBN-13 9781788473026
Length 322 pages
Edition 1st Edition
Languages
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Rivu Chakraborty Rivu Chakraborty
Author Profile Icon Rivu Chakraborty
Rivu Chakraborty
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. A Short Introduction to Reactive Programming 2. Functional Programming with Kotlin and RxKotlin FREE CHAPTER 3. Observables, Observers, and Subjects 4. Introduction to Backpressure and Flowables 5. Asynchronous Data Operators and Transformations 6. More on Operators and Error Handling 7. Concurrency and Parallel Processing in RxKotlin with Schedulers 8. Testing RxKotlin Applications 9. Resource Management and Extending RxKotlin 10. Introduction to Web Programming with Spring for Kotlin Developers 11. REST APIs with Spring JPA and Hibernate 12. Reactive Kotlin and Android

Preface

Is our world just a collection of states? No. Then why do all the programming paradigms represent our world as a series of states? Can't we reflect objects that are real, moving, and continuously changing state in programming? These are the questions that have interested me ever since I first learned programming.

When I started working as an Android developer, these questions continued to plague me, but got some friends as well. Why do we need so many loops in an application? Isn't there anything to replace the iterators? Also, for Android applications, we must keep a lot of things in mind, as the processors and RAM in a mobile device are not as powerful as those in your PC. There is often an Out of Memory Exception if you do not structure your projects well. So, if we could have less iterators in our program, the UX will significantly improve, but, how do we do it? How do we replace iterators, and with what?

One fine day, I read a blog post about reactive programming and the ReactiveX Framework, (most probably by Thomas Nield, thanks to him), and it gave me a glimpse of the answers to all my questions. So, I started learning reactive programming.

I found out that the learning curve of reactive programming is very much complex, and many developers out there leave it part way through. Reactive programming is considered an advanced topic in most places. However, I continued my journey toward learning reactive programming, and as a reward for my patience and consistency, I got answers to my questions. RxJava (and all other ReactiveX libraries) represents models just like our real-time world, and, unlike states, they model behavior with moving and continuously changing states. Unlike an iterator pattern, it believes on push mechanism, which will push data/event to the subscriber/observer as it comes, making the programming a lot more easier and a lot more like the human world.

On the other hand, around 2 years ago (in December 2015), when I read a Jetbrains blog (yes, I do read a lot, and write as well) about a new language that will work in JVM, my first thought was, why a new language? So, I started exploring Kotlin, and I fell in love with it. The sole purpose of the language is making programming a lot easier. Whenever someone speaks about the benefits of Kotlin, they talk about handling null pointer exceptions so easily, but there are a lot more advantages; the list is never-ending and continues to grow.

The best thing that can happen to a programmer is combining the Kotlin and ReactiveX Frameworks; Mario Arias did this awesome job for the sake of the Developers Community and started RxKotlin on October 2013.

The only thing that RxKotlin lacks is documentation; I personally believe that the main reason behind the complex learning curve of ReactiveX libraries is a lack of documentation and, mostly, a lack of awareness. I've seen a lot of developers, even with more than 6-8 years of experience who have not heard of reactive programming; I believe this book will have a bigger role in changing this scenario. This book is also a part of my mission (also the mission of Kotlin Kolkata User Group) to spread the use and knowledge of Kotlin as much as possible.

As per as my knowledge, this is the first book that helps you learn reactive programming in Kotlin, covering RxKotlin (precisely RxKotlin 2.0) and the Reactor-Kotlin Framework. It is a step-by-step guide to learn RxKotlin and Reactor-Kotlin with added coverage on Spring and Android. I hope this book will help you find the benefits of Kotlin and reactive programming altogether, and, with the help of this book, you will be able to successfully apply reactive programming to all your Kotlin projects.

If you have any concerns, feedback, or comments, you can contact me through my site http://www.rivuchk.com, or drop an email to rivu@rivuchk.com. Make sure to mention Book Query - Reactive Programming in Kotlin in the subject of the email.

lock icon The rest of the chapter is locked
Next Section arrow right
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime