O'Reilly logo

Reactive Android Programming by Tadas Subonis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Tweet retrieval Observable

The identical approach should be applied to the Observable that's responsible for the retrieval of the tweets for the keywords that we are monitoring:

observeTwitterStream(configuration, filterQuery)        .sample(2700, TimeUnit.MILLISECONDS)        .map(StockUpdate::create)        .filter(containsAnyOfKeywords(trackingKeywords))        .flatMapMaybe(skipTweetsThatDoNotContainKeywords(trackingKeywords))

This block can be named as shown:

createTweetStockUpdateObservable()

It will have the body of the following:

private Observable<StockUpdate> createTweetStockUpdateObservable(Configuration configuration, String[] trackingKeywords, FilterQuery filterQuery) {    return observeTwitterStream(configuration, filterQuery)            .sample(2700, TimeUnit. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required