The concept of Reactive Streams (aka Reactive Extensions, Reactive Functional Programming, or simply Rx) has become increasingly popular recently, and with good reason. The Reactive Streams specification provides a universal abstraction for asynchronously processing data received across multiple sources (e.g. database, user input, third-party services), and includes mechanisms for controlling the rate at which data is received. This makes it a powerful tool within a Microservice platform. And did we mention that the Groovy lang community is quite involved?
In this talk we’ll explore the various features and concepts of Reactive Streams. We’ll talk about some typical use cases for Rx and more importantly, how to implement them. We’ll focus primarily on RxGroovy and Ratpack, then provide example implementations that show you how to get started with this powerful technique.
What is Rx?
• Collections + Time
• A Single Abstraction over data from different sources
• Observer Pattern with Push-based iterators
• Stream Based Functional Programming
• … with Extensions for Reactive Programming
• Async is easy
Don’t Unsubscribe from Observables
Programmatically complete them
when another Observable fires
• Wait 250 ms between keypresses before querying
• If no keys are pressed, no query
• Successful queries should render movies
• Any new queries should kill in-flight queries