官术网_书友最值得收藏!

Reactive programming

Reactive programming is a related programming paradigm. A spreadsheet is an excellent example of a reactive application. If we set a formula and change any column value, the spreadsheet program reacts and computes the new result columns.

A message-driven architecture is the foundation of Reactive applications. A message-driven application may be event-driven, actor-based, or a combination of the two.

The following is a diagram of observable composition:

Composable event streams make event handling easier to understand. Reactive Extensions (Rx) is a framework that provides composable observables. At the heart of this framework is the observer pattern, with a functional flavor. The framework allows us to compose multiple observables. The observers are given the resulting event stream in an asynchronous fashion. For more information, see http://reactivex.io/intro.html 

Function of composition is shown in the following code:   

This Scala code shows five standalone methods. Each method is converted to a function and then collected in a variable, list. The reduceRightcall iterates over this list and composes all the functions into a bigger one, f.

The f("hello") call shows that the composition has worked!

主站蜘蛛池模板: 雅安市| 明光市| 水富县| 建德市| 盘锦市| 屏边| 永春县| 敦化市| 高阳县| 元阳县| 岳西县| 姜堰市| 大竹县| 和田市| 逊克县| 汕头市| 观塘区| 衡南县| 五家渠市| 上思县| 囊谦县| 赣榆县| 常宁市| 甘洛县| 邯郸市| 衡山县| 平定县| 吴川市| 丹巴县| 当雄县| 达拉特旗| 泰州市| 南平市| 郴州市| 青川县| 通城县| 廉江市| 武夷山市| 崇明县| 神池县| 陕西省|