- Spring 5.0 Projects
- Nilang Patel
- 282字
- 2021-07-02 12:35:01
Backpressure
One of the important concepts that you should know about in Reactive Programming is backpressure. It significantly improves Reactive Programming over the traditional code. What exactly is it? It is considered as one of the non-blocking regulatory mechanisms used to send asynchronous messages or feedback to the source of a stream for load regulation. Communication back to the stream sender could possibly be a request or alert to stop. However, it could also be about the receiver's intent to process more messages. The communication back to the sender has to be non-blocking. This is important.
Consider the situation where observables (source of an event) send out the data at a higher rate than the subscribers can actually handle. In this case, the subscribers would be in a stress condition, unable to handle the flow properly, and there is a high chance the system would behave unexpectedly. To avoid this situation, there must be some arrangement for conveying the speed at which the subscribers can consume the data, back to the observables.
The mechanism for notifying the source of the event saying, Hey, I am under pressure, so don't send a further message as I can consume X amount of messages at a particular time, is called backpressure. In the absence of this, the system may keep increasing the buffer size until it runs out of memory error. Backpressure is required when emission happens at a faster rate than consumption. It will make sure the system remains resilient under the load and will provide information that is used to make the decision, whether the system needs additional resources or not.
- Modern JavaScript Web Development Cookbook
- RCNP實驗指南:構建高級的路由互聯網絡(BARI)
- 網絡協(xié)議工程
- 連接未來:從古登堡到谷歌的網絡革命
- Building E-commerce Sites with VirtueMart Cookbook
- 物聯網(IoT)基礎:網絡技術+協(xié)議+用例
- 通信簡史:從信鴿到6G+
- 物聯網之霧:基于霧計算的智能硬件快速反應與安全控制
- Bonita Open Solution 5.x Essentials
- Master Apache JMeter:From Load Testing to DevOps
- Learning Storm
- 工業(yè)互聯網創(chuàng)新實踐
- 無線傳感器網絡定位技術
- 數據血緣分析原理與實踐
- 5G非正交多址接入技術:理論、算法與實現