
Reactive Programming with Rxjava
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
More details
Other editions
Additional editions

Content
- Intro
- Copyright
- Table of Contents
- Foreword
- Introduction
- Who Should Read This Book
- Note from Ben Christensen
- Note from Tomasz Nurkiewicz
- Navigating This Book
- Online Resources
- Conventions Used in This Book
- Safari® Books Online
- How to Contact Us
- Acknowledgments
- From Ben
- From Tomasz
- Chapter 1. Reactive Programming with RxJava
- Reactive Programming and RxJava
- When You Need Reactive Programming
- How RxJava Works
- Push versus Pull
- Async versus Sync
- Concurrency and Parallelism
- Lazy versus Eager
- Duality
- Cardinality
- Mechanical Sympathy: Blocking versus Nonblocking I/O
- Reactive Abstraction
- Chapter 2. Reactive Extensions
- Anatomy of rx.Observable
- Subscribing to Notifications from Observable
- Capturing All Notifications by Using Observer&T&
- Controlling Listeners by Using Subscription and Subscriber&T&
- Creating Observables
- Mastering Observable.create()
- Infinite Streams
- Timing: timer() and interval()
- Hot and Cold Observables
- Use Case: From Callback API to Observable Stream
- Manually Managing Subscribers
- rx.subjects.Subject
- ConnectableObservable
- Single Subscription with publish().refCount()
- ConnectableObservable Lifecycle
- Summary
- Chapter 3. Operators and Transformations
- Core Operators: Mapping and Filtering
- 1-to-1 Transformations Using map()
- Wrapping Up Using flatMap()
- Postponing Events Using the delay() Operator
- Order of Events After flatMap()
- Preserving Order Using concatMap()
- More Than One Observable
- Treating Several Observables as One Using merge()
- Pairwise Composing Using zip() and zipWith()
- When Streams Are Not Synchronized with One Another: combineLatest(), withLatestFrom(), and amb()
- Advanced Operators: collect(), reduce(), scan(), distinct(), and groupBy()
- Scanning Through the Sequence with Scan and Reduce
- Reduction with Mutable Accumulator: collect()
- Asserting Observable Has Exactly One Item Using single()
- Dropping Duplicates Using distinct() and distinctUntilChanged()
- Slicing and Dicing Using skip(), takeWhile(), and Others
- Ways of Combining Streams: concat(), merge(), and switchOnNext()
- Criteria-Based Splitting of Stream Using groupBy()
- Where to Go from Here?
- Writing Customer Operators
- Reusing Operators Using compose()
- Implementing Advanced Operators Using lift()
- Summary
- Chapter 4. Applying Reactive Programming to Existing Applications
- From Collections to Observables
- BlockingObservable: Exiting the Reactive World
- Embracing Laziness
- Composing Observables
- Lazy paging and concatenation
- Imperative Concurrency
- flatMap() as Asynchronous Chaining Operator
- Replacing Callbacks with Streams
- Polling Periodically for Changes
- Multithreading in RxJava
- What Is a Scheduler?
- Declarative Subscription with subscribeOn()
- subscribeOn() Concurrency and Behavior
- Batching Requests Using groupBy()
- Declarative Concurrency with observeOn()
- Other Uses for Schedulers
- Summary
- Chapter 5. Reactive from Top to Bottom
- Beating the C10k Problem
- Traditional Thread-Based HTTP Servers
- Nonblocking HTTP Server with Netty and RxNetty
- Benchmarking Blocking versus Reactive Server
- Reactive HTTP Servers Tour
- HTTP Client Code
- Nonblocking HTTP Client with RxNetty
- Relational Database Access
- NOTIFY AND LISTEN on PostgreSQL Case Study
- CompletableFuture and Streams
- A Short Introduction to CompletableFuture
- Interoperability with CompletableFuture
- Observable versus Single
- Creating and Consuming Single
- Combining Responses Using zip, merge, and concat
- Interoperability with Observable and CompletableFuture
- When to Use Single?
- Summary
- Chapter 6. Flow Control and Backpressure
- Flow Control
- Taking Periodic Samples and Throttling
- Buffering Events to a List
- Moving window
- Skipping Stale Events by Using debounce()
- Backpressure
- Backpressure in RxJava
- Built-in Backpressure
- Producers and Missing Backpressure
- Honoring the Requested Amount of Data
- Summary
- Chapter 7. Testing and Troubleshooting
- Error Handling
- Where Are My Exceptions?
- Declarative try-catch Replacement
- Timing Out When Events Do Not Occur
- Retrying After Failures
- Testing and Debugging
- Virtual Time
- Schedulers in Unit Testing
- Unit Testing
- Monitoring and Debugging
- doOn.() Callbacks
- Measuring and Monitoring
- Summary
- Chapter 8. Case Studies
- Android Development with RxJava
- Avoiding Memory Leaks in Activities
- Retrofit with Native RxJava Support
- Schedulers in Android
- UI Events as Streams
- Managing Failures with Hystrix
- The First Steps with Hystrix
- Nonblocking Commands with HystrixObservableCommand
- Bulkhead Pattern and Fail-Fast
- Batching and Collapsing Commands
- Monitoring and Dashboards
- Querying NoSQL Databases
- Couchbase Client API
- MongoDB Client API
- Camel Integration
- Consuming Files with Camel
- Receiving Messages from Kafka
- Java 8 Streams and CompletableFuture
- Usefulness of Parallel Streams
- Choosing the Appropriate Concurrency Abstraction
- When to Choose Observable?
- Memory Consumption and Leaks
- Operators Consuming Uncontrolled Amounts of Memory
- Summary
- Chapter 9. Future Directions
- Reactive Streams
- Observable and Flowable
- Performance
- Migration
- Appendix A. More HTTP Server Examples
- fork() Procedure in C Language
- Thread per Connection
- Thread Pool of Connections
- Appendix B. A Decision Tree of Observable Operators
- Index
- About the Authors
- Colophon
System requirements
File format: PDF
Copy-Protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (only limited: Kindle).
The file format PDF always displays a book page identically on any hardware. This makes PDF suitable for complex layouts such as those used in textbooks and reference books (images, tables, columns, footnotes). Unfortunately, on the small screens of e-readers or smartphones, PDFs are rather annoying, requiring too much scrolling.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our eBook Help page.