- Spring 5.0 Projects
- Nilang Patel
- 338字
- 2021-07-02 12:35:01
Reactive Programming techniques
Reactive Programming is event-based in most cases. In Reactive Programming, the APIs are exposed in the following two flavors:
- Callback: In this type, the anonymous routines are registered to event sources as callback functions. They will be invoked when the event is triggered by the data flow.
- Declarative: The events are observed through well-defined functional compositions, like a filter, map, and other stream-based operations, like count, trigger, and so on.
Reactive Programming puts the importance on data flow rather than the flow of control, so it is not uncommon to consider it as a data flow programming. There are various techniques that are used to achieve Reactive Programming as follows:
- Futures and promise: It is referred to as a technique to define the variable and assign its value. Though futures and promise are used interchangeably, they are not exactly the same. The future is used to describe a read-only view of a variable (or, say, define the variable), while the promise is a writable, single assignment container that is used to set the value of a variable in future.
- Reactive Streams: It is defined as a standard for the processing of asynchronous streams that enables non-blocking, backpressure transmutations between sources from where the events are initiated and the destination where they are observed.
- Data flow variables: It is a variable whose value depends on a given input, operations, and other cells, and is updated automatically when changes happen to source entities. You can think of a data flow variable as a spreadsheet cell, where a change in the value of one cell causes a ripple effect to others based on the assigned formula.
In addition to this, there are various frontend libraries available, like React.js, AngularJS, Ractive.js, Node.js, and so on, which are used to develop reactive frontend applications. Other programming languages and frameworks providing native support for reactive applications are Scala, Clojure, and GoLang, along with Java 9 and Spring 5. We will see reactive features of Spring 5 later in this chapter.
- 計算機網(wǎng)絡(luò)與通信(第2版)
- 網(wǎng)絡(luò)協(xié)議工程
- 解析QUIC/HTTP3:未來互聯(lián)網(wǎng)的基石
- Hands-On Chatbot Development with Alexa Skills and Amazon Lex
- Hands-On Full Stack Development with Spring Boot 2 and React(Second Edition)
- 物聯(lián)網(wǎng)與無線傳感器網(wǎng)絡(luò)
- Spring 5.0 Projects
- 邁向自智網(wǎng)絡(luò)時代:IP自動駕駛網(wǎng)絡(luò)
- 面向5G-Advanced的關(guān)鍵技術(shù)
- 基于性能的保障理論與方法
- 網(wǎng)管第一課:網(wǎng)絡(luò)操作系統(tǒng)與配置管理
- Qt5 Python GUI Programming Cookbook
- SRv6網(wǎng)絡(luò)部署指南
- 區(qū)塊鏈技術(shù)與應(yīng)用:打造分布式商業(yè)新生態(tài)
- INSTANT Social Media Marketing with HootSuite