Learning Reactive Programming with Java 8
eBook - ePub

Learning Reactive Programming with Java 8

Nickolay Tsvetinov

Share book
  1. 182 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Learning Reactive Programming with Java 8

Nickolay Tsvetinov

Book details
Book preview
Table of contents
Citations

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on ā€œCancel Subscriptionā€ - itā€™s as simple as that. After you cancel, your membership will stay active for the remainder of the time youā€™ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlegoā€™s features. The only differences are the price and subscription period: With the annual plan youā€™ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, weā€™ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Learning Reactive Programming with Java 8 an online PDF/ePUB?
Yes, you can access Learning Reactive Programming with Java 8 by Nickolay Tsvetinov in PDF and/or ePUB format, as well as other popular books in Informatik & Anwendungsentwicklung. We have over one million books available in our catalogue for you to explore.

Information

Year
2015
ISBN
9781785288722

Learning Reactive Programming with Java 8


Table of Contents

Learning Reactive Programming with Java 8
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. An Introduction to Reactive Programming
What is reactive programming?
Why should we be reactive?
Introducing RxJava
Downloading and setting up RxJava
Comparing the iterator pattern and the RxJava Observable
Implementing the reactive sum
Summary
2. Using the Functional Constructions of Java 8
Lambdas in Java 8
Introducing the new syntax and semantics
Functional interfaces in Java 8 and RxJava
Implementing the reactive sum example with lambdas
Pure functions and higher order functions
Pure functions
Higher order functions
RxJava and functional programming
Summary
3. Creating and Connecting Observables, Observers, and Subjects
The Observable.from method
The Observable.just method
Other Observable factory methods
The Observable.create method
Subscribing and unsubscribing
Hot and cold Observable instances
The ConnectableObservable class
The Subject instances
Summary
4. Transforming, Filtering, and Accumulating Your Data
Observable transformations
Transformations with the various flatMap operators
Grouping items
Additional useful transformation operators
Filtering data
Accumulating data
Summary
5. Combinators, Conditionals, and Error Handling
Combining the Observable instances
The zip operator
The combineLatest operator
The merge operator
The concat operator
The conditional operators
The amb operator
The takeUntil(), takeWhile(), skipUntil(), and skipWhile() conditional operators
The defaultIfEmpty( ) operator
Handling errors
The return and resume operators
The retrying technique
An HTTP client example
Summary
6. Using Concurrency and Parallelism with Schedulers
RxJava's schedulers
Debugging Observables and their schedulers
The interval Observable and its default scheduler
Types of schedulers
The Schedulers.immediate scheduler
The Schedulers.trampoline scheduler
The Schedulers.newThread scheduler
The Schedulers.computation scheduler
The Schedulers.io scheduler
The Schedulers.from(Executor) method
Combining Observables and schedulers
The Observable<T> subscribeOn(Scheduler) method
The Observable<T> observeOn(Scheduler) operator
Parallelism
Buffering, throttling, and debouncing
Throttling
Debouncing
The buffer and window operators
The backpressure operators
Summary
7. Testing Your RxJava Application
Testing using simple subscription
The BlockingObservable class
The aggregate operators and the BlockingObservable class
Testing with the aggregate operators and the BlockingObservable class
Using the TestSubscriber class for in-depth testing
Testing asynchronous Observable instances with the help of the TestScheduler class
Summary
8. Resource Management and Extending RxJava
Resource management
Introducing the Observable.using method
Caching data with Observable.cache
Creating custom operators with lift
Composing multiple operators with the Observable.compose operator
Summary
Index

Learning Reactive Programming with Java 8

Copyright Ā© 2015 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 2015
Production reference: 1170615
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78528-872-2
www.packtpub.com

Credits

Author
Nickolay Tsvetinov
Reviewers
Samuel Gruetter
DƔvid Karnok
Timo Tuominen
Shixiong Zhu
Commissioning Editor
Veena Pagare
Acquisition Editor
Larrisa Pinto
Content Development Editor
Adrian Raposo
Technical Editor
Abhishek R. Kotian
Copy Editors
Brandt D'mello
Neha Vyas
Project Coordinator
Sanchita Mandal
Proofreader
Safis Editing
Indexer
Mariammal Chettiyar
Production Coordinator
Conidon Miranda
Cover Work
Conidon Miranda

About the Author

Nickolay Tsvetinov is a professional all-round web developer at TransportAPIā€”Britain's first comprehensive open platform for transport solutions. During his career as a software developer, he experienced both good and bad and played with most of the popular programming languagesā€”from C and Java to Ruby and JavaScript. For the last 3-4 years, he's been creating and maintaining single-page applications (SPA) and the backend API architectures that serve them. He is a fan of open source software, Rails, Vim, Sinatra, Ember.js, Node.js, and Nintendo. He was an unsuccessful musician and poet, but he is a successful husband and father. His area of interest and expertise includes the declarative/functional and reactive programming that resulted in the creation of ProAct.js (http://proactjs.com), which is a library that augments the JavaScript language and turns it into a reactive language.

Table of contents