Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the term "backpressure" mean in Rxjava?

Tags:

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)

like image 365
ohlab Avatar asked Oct 01 '17 23:10

ohlab


People also ask

What is back pressure in programming?

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 is data back pressure?

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.

How do you handle backpressure?

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)

What is back pressure stream?

There is a general problem that occurs during data handling called backpressure and describes a buildup of data behind a buffer during data transfer.


1 Answers

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

like image 63
akhilesh0707 Avatar answered Oct 21 '22 04:10

akhilesh0707