Backpressure in Reactive Extensions
We usually think of Observables as streams of data that are produced by the source Observable on one end and consumed by an observer at the other end. While this is still correct, we're not aware of situations where the Observable is emitting values so fast that the consumer (the observer) is not able to handle them.
This could lead to significant memory or CPU usage, which we definitely want to avoid.
There're two groups of operators suitable for backpressure, although most of them aren't available in RxPHP and are related mostly to RxJS:
Lossy: In this group, some values are discarded and never arrive at the observers. For example, this could be the mouse position sampled over a certain timespan. We're usually interested in the current mouse position right now; we don't care about position in the past, and so this can be completely ignored.
Loss-less: In this group, values are stacked in operators and are typically emitted in batches. We don't want to...