Writing Custom Observables

In this chapter, we will enhance the stock monitoring application with an ability to fetch updates about certain companies from a Twitter stream using the Twitter4J library.

However, in order to do that, we will need to learn how to plug non-reactive code into RxJava. There are a few ways to wrap plain Java code and turn it into an Observable. We will see how to do this using Java's Futures and Callables, and we will explore how Emitter interface can be used to work with hot Observables.

Finally, we will adapt the Twitter4J library into our Reactive workflow, and we will show updates related to the followed companies on the UI.

Topics covered in this chapter are as follows:

  • How to create Observables using standard Java API
  • How to create custom Observables using Emitter API
  • Twitter and Twitter4J setup in the project
  • How to adapt libraries into a reactive API
  • Plugging the Reactive Twitter stream in to the UI
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.37.10