Açıklaması şöyle. Yani hızlı bir Producer ve yavaş bir Consumer varsa, Producer bu durum karşısında ezilmez.
... considering a fast data producer and a slow data consumer, backpressure is the mechanism that 'pushes back' on the producer not to be overwhelmed by data.
Şeklen şöyle
Açıklaması şöyle. Producer'ın ezilmemesinin sebebi, tüketen tarafın Subscription.request() metodu ile veriyi çekmesi.
A Subscriber MUST signal demand via Subscription.request(long n) to receive onNext signals.The intent of this rule is to establish that it is the responsibility of the Subscriber to decide when and how many elements it is able and willing to receive. To avoid signal reordering caused by reentrant Subscription methods, it is strongly RECOMMENDED for synchronous Subscriber implementations to invoke Subscription methods at the very end of any signal processing. It is RECOMMENDED that Subscribers request the upper limit of what they are able to process, as requesting only one element at a time results in an inherently inefficient "stop-and-wait" protocol.-- Reactive Streams specifications for the JVM
Açıklaması şöyle
To cope with that, RxJava offers two main strategies to handle 'overproduced' items:1. Store items in a buffer2. Drop items
Sınıflar şöyle
Flowable
Açıklaması şöyle
A flow of 0..N items. It supports Reactive-Streams and backpressure.Observable
Hiç yorum yok:
Yorum Gönder