Reactive Programming in Kotlin

Learn how to implement Reactive Programming paradigms with Kotlin, and apply them to web programming with Spring Framework 5.0 and in Android Application Development.
Preview in Mapt

Reactive Programming in Kotlin

Rivu Chakraborty

6 customer reviews
Learn how to implement Reactive Programming paradigms with Kotlin, and apply them to web programming with Spring Framework 5.0 and in Android Application Development.

Quick links: > What will you learn?> Table of content> Product reviews

eBook
$5.00
RRP $35.99
Save 86%
Print + eBook
$44.99
RRP $44.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$5.00
$44.99
RRP $35.99
RRP $44.99
eBook
Print + eBook

Frequently bought together


Reactive Programming in Kotlin Book Cover
Reactive Programming in Kotlin
$ 35.99
$ 5.00
Mastering Android Development with Kotlin Book Cover
Mastering Android Development with Kotlin
$ 35.99
$ 5.00
Buy 2 for $10.00
Save $61.98
Add to Cart

Book Details

ISBN 139781788473026
Paperback322 pages

Book Description

In today’s app-driven era, when programs are asynchronous, and responsiveness is so vital, reactive programming can help you write code that’s more reliable, easier to scale, and better-performing. Reactive programming is revolutionary.

With this practical book, Kotlin developers will first learn how to view problems in the reactive way, and then build programs that leverage the best features of this exciting new programming paradigm. You will begin with the general concepts of Reactive programming and then gradually move on to working with asynchronous data streams. You will dive into advanced techniques such as manipulating time in data-flow, customizing operators and provider and how to Use the concurrency model to control asynchronicity of code and process event handlers effectively.

You will then be introduced to functional reactive programming and will learn to apply FRP in practical use cases in Kotlin. This book will also take you one step forward by introducing you to spring 5 and spring boot 2 using Kotlin. By the end of the book, you will be able to build real-world applications with reactive user interfaces as well as you’ll learn to implement reactive programming paradigms in Android.

Table of Contents

Chapter 1: A Short Introduction to Reactive Programming
What is reactive programming?
Reasons to adapt functional reactive programming
Reactive Manifesto
Getting started with RxKotlin
The ReactiveCalculator project
Summary
Chapter 2: Functional Programming with Kotlin and RxKotlin
Introducing functional programming
Fundamentals of functional programming
Applying functional programming to the ReactiveCalculator class
Coroutines
Functional programming – monads
Summary
Chapter 3: Observables, Observers, and Subjects
Observables
Other Observable factory methods
Hot and Cold Observables
Varieties of Subject
Summary
Chapter 4: Introduction to Backpressure and Flowables
Understanding backpressure
Flowable
When to use Flowables and Observables
Flowable and Subscriber
Creating Flowable from scratch
Creating Flowable from Observable
BackpressureStrategy.MISSING and onBackpressureXXX()
Generating Flowable with backpressure at source
ConnectableFlowable
Processor
Learning Buffer, Throttle, and Window operators
Summary
Chapter 5: Asynchronous Data Operators and Transformations
Operator
The filtering/suppressing operators
The transforming operators
Reducing operators
The error handling operators
The utility operators
Summary
Chapter 6: More on Operators and Error Handling
Combining producers (Observable/Flowable)
Grouping
flatMap, concatMap – In details
Understanding switchMap operator
Skipping and taking emissions
The error handling operators
onErrorReturn – return a default value on error
The onErrorResumeNext operator
An HTTP example
Summary
Chapter 7: Concurrency and Parallel Processing in RxKotlin with Schedulers
Introduction to concurrency
Parallel execution versus concurrency
What is a scheduler?
How to use schedulers – subscribeOn and observeOn operators
Summary
Chapter 8: Testing RxKotlin Applications
Introduction to unit testing and its importance
Writing JUnit tests in Kotlin
Testing in RxKotlin
Blocking subscribers
Blocking operators
Introducing TestObserver and TestSubscriber
Understanding TestScheduler
Summary
Chapter 9: Resource Management and Extending RxKotlin
Resource management
Creating your own operators
Composing operators with transformer
Summary
Chapter 10: Introduction to Web Programming with Spring for Kotlin Developers
Spring, history, and origin of Spring
Dependency injection and IoC
Spring – AOP
Introduction to Spring Boot
Creating a Rest API with Spring Boot
Summary
Chapter 11: REST APIs with Spring JPA and Hibernate
REST API with Spring Boot, Hibernate, and JPA
Reactive programming with Reactor
Summary
Chapter 12: Reactive Kotlin and Android
Setting up Kotlin in Android Studio
Getting started with ToDoApp on Android
Retrofit 2 for API calls
RxKotlin with Retrofit
Making Android events reactive
Kotlin extensions
Summary

What You Will Learn

  • Learn about reactive programming paradigms and how reactive programming can improve your existing projects
  • Gain in-depth knowledge in RxKotlin 2.0 and the ReactiveX Framework
  • Use RxKotlin with Android
  • Create your own custom operators in RxKotlin
  • Use Spring Framework 5.0 with Kotlin
  • Use the reactor-kotlin extension
  • Build Rest APIs with Spring,Hibernate, and RxKotlin
  • Use testSubscriber to test RxKotlin applications
  • Use backpressure management and Flowables

Authors

Table of Contents

Chapter 1: A Short Introduction to Reactive Programming
What is reactive programming?
Reasons to adapt functional reactive programming
Reactive Manifesto
Getting started with RxKotlin
The ReactiveCalculator project
Summary
Chapter 2: Functional Programming with Kotlin and RxKotlin
Introducing functional programming
Fundamentals of functional programming
Applying functional programming to the ReactiveCalculator class
Coroutines
Functional programming – monads
Summary
Chapter 3: Observables, Observers, and Subjects
Observables
Other Observable factory methods
Hot and Cold Observables
Varieties of Subject
Summary
Chapter 4: Introduction to Backpressure and Flowables
Understanding backpressure
Flowable
When to use Flowables and Observables
Flowable and Subscriber
Creating Flowable from scratch
Creating Flowable from Observable
BackpressureStrategy.MISSING and onBackpressureXXX()
Generating Flowable with backpressure at source
ConnectableFlowable
Processor
Learning Buffer, Throttle, and Window operators
Summary
Chapter 5: Asynchronous Data Operators and Transformations
Operator
The filtering/suppressing operators
The transforming operators
Reducing operators
The error handling operators
The utility operators
Summary
Chapter 6: More on Operators and Error Handling
Combining producers (Observable/Flowable)
Grouping
flatMap, concatMap – In details
Understanding switchMap operator
Skipping and taking emissions
The error handling operators
onErrorReturn – return a default value on error
The onErrorResumeNext operator
An HTTP example
Summary
Chapter 7: Concurrency and Parallel Processing in RxKotlin with Schedulers
Introduction to concurrency
Parallel execution versus concurrency
What is a scheduler?
How to use schedulers – subscribeOn and observeOn operators
Summary
Chapter 8: Testing RxKotlin Applications
Introduction to unit testing and its importance
Writing JUnit tests in Kotlin
Testing in RxKotlin
Blocking subscribers
Blocking operators
Introducing TestObserver and TestSubscriber
Understanding TestScheduler
Summary
Chapter 9: Resource Management and Extending RxKotlin
Resource management
Creating your own operators
Composing operators with transformer
Summary
Chapter 10: Introduction to Web Programming with Spring for Kotlin Developers
Spring, history, and origin of Spring
Dependency injection and IoC
Spring – AOP
Introduction to Spring Boot
Creating a Rest API with Spring Boot
Summary
Chapter 11: REST APIs with Spring JPA and Hibernate
REST API with Spring Boot, Hibernate, and JPA
Reactive programming with Reactor
Summary
Chapter 12: Reactive Kotlin and Android
Setting up Kotlin in Android Studio
Getting started with ToDoApp on Android
Retrofit 2 for API calls
RxKotlin with Retrofit
Making Android events reactive
Kotlin extensions
Summary

Book Details

ISBN 139781788473026
Paperback322 pages
Read More
From 6 reviews

Read More Reviews

Recommended for You

Mastering Android Development with Kotlin Book Cover
Mastering Android Development with Kotlin
$ 35.99
$ 5.00
Kotlin Programming By Example Book Cover
Kotlin Programming By Example
$ 39.99
$ 5.00
Mastering Swift 4 - Fourth Edition Book Cover
Mastering Swift 4 - Fourth Edition
$ 35.99
$ 5.00
Kotlin in Practice [Video] Book Cover
Kotlin in Practice [Video]
$ 124.99
$ 5.00
Rust Programming By Example Book Cover
Rust Programming By Example
$ 35.99
$ 5.00
Unity 2017 Game AI programming - Third Edition Book Cover
Unity 2017 Game AI programming - Third Edition
$ 39.99
$ 5.00