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

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 backpressureIn 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. 

主站蜘蛛池模板: 二连浩特市| 龙南县| 沂南县| 楚雄市| 射洪县| 常熟市| 唐山市| 凯里市| 岳阳市| 红安县| 开原市| 贵南县| 金阳县| 长汀县| 陇南市| 洞口县| 潜山县| 尚义县| 德庆县| 长丰县| 雷山县| 容城县| 成武县| 乌审旗| 咸阳市| 弥渡县| 宁安市| 临澧县| 洛宁县| 清徐县| 鄱阳县| 西青区| 任丘市| 天镇县| 长武县| 延边| 屯昌县| 卢氏县| 元朗区| 彩票| 雅安市|