I am a beginner of RxJava and I am curious about the meaning of "backpressure".
Does it mean that the producer puts pressure behind the consumer's back?
Or does it mean that consumers are putting pressure on producers? (Pressure in opposite direction)
Backpressure in software systems is the capability to overload the traffic communication. In other words, emitters of information overwhelm consumers with data they are not able to process. Eventually, people also apply this term as the mechanism to control and handle it.
What Does Backpressure Mean? Backpressure refers to the buildup of data at an I/O switch when buffers are full and not able to receive additional data. No additional data packets are transferred until the bottleneck of data has been eliminated or the buffer has been emptied.
Aside from scaling up your available compute resources, how you handle backpressure can pretty much be summed up with three possible options: Control the producer (slow down/speed up is decided by consumer) Buffer (accumulate incoming data spikes temporarily) Drop (sample a percentage of the incoming data)
There is a general problem that occurs during data handling called backpressure and describes a buildup of data behind a buffer during data transfer.
RxJava Backpressure
When you have an observable which emits items so fast that consumer can’t keep up with the flow leading to the existence of emitted but unconsumed items.
How unconsumed items, which are emitted by observables but not consumed by subscribers, are managed and controlled is what backpressure strategy deals with.
Since it requires system resources to handle backpressure, you need to choose right backpressure strategy that suits your requirement.
More Info ref link
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With