Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Learning Reactive Programming With Java 8
  • Table Of Contents Toc
  • Feedback & Rating feedback
Learning Reactive Programming With Java 8

Learning Reactive Programming With Java 8

By : Nickolay Tzvetinov
3.6 (5)
close
close
Learning Reactive Programming With Java 8

Learning Reactive Programming With Java 8

3.6 (5)
By: Nickolay Tzvetinov

Overview of this book

If you are a Java developer that knows how to write software and would like to learn how to apply your existing skills to reactive programming, this book is for you.
Table of Contents (10 chapters)
close
close
9
Index

Composing multiple operators with the Observable.compose operator


The compose() operator has one parameter of type Transformer. The Transformer interface, like the Operator one, is an empty interface that extends Func1 (this approach hides the type complexities that are involved by using Func1). The difference is that it extends the Func1<Observable<T>, Observable<R>> method, so that it transforms an Observable and not a Subscriber. This means that, instead of operating on each individual item emitted by the source observable, it operates directly on the source.

We can illustrate the use of this operator and the Transformer interface through an example. First, we will create a Transformer implementation:

public class OddFilter<T> implements Transformer<T, T> {
  @Override
  public Observable<T> call(Observable<T> observable) {
    return observable
      .lift(new Indexed<T>(1L))
      .filter(pair -> pair.getLeft() % 2 == 1)
      .map(pair...
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Learning Reactive Programming With Java 8
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon