Reactive programming with RxGo
ReactiveX (http://reactivex.io/) is an API for programming with observable streams. RxGo (github.com/reactivex/rxgo) is a library to support this pattern in Go. It helps you to think of your application as a big stream of events that responds in different ways when those events occur. This recipe will create an application that uses this approach to process different wines. Ideally, this approach can be tied to wine data or wine APIs and can aggregate information about wine.
Getting ready
Configure your environment according to these steps:
- Refer to the Getting ready section of the Goflow for dataflow programming recipe in this chapter.
- Run the
go get github.com/reactivex/rxgo
command.
How to do it...
These steps cover writing and running your application:
- From your terminal/console application, create the
chapter11/reactive
directory and navigate to it. - Copy tests from https://github.com/agtorre/go-cookbook/tree/master/chapter11/reactive or use this as an exercise...