- 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.
- 物聯網網絡安全及應用
- 電子政務效益的經濟分析與評價
- OpenLayers Cookbook
- 互聯網安全的40個智慧洞見:2015年中國互聯網安全大會文集
- 網絡的琴弦:玩轉IP看監控
- Mastering TypeScript 3
- TD-LTE無線網絡規劃與設計
- 互聯網+思維與創新:通往未來的+號
- Practical Web Penetration Testing
- Implementing NetScaler VPX?
- LwIP應用開發實戰指南:基于STM32
- 精通SEO:100%網站流量提升密碼
- 物聯網與智慧農業
- Intelligent Mobile Projects with TensorFlow
- Cisco無線局域網配置基礎