Unbounded backpressure in Flowable

21 views
Skip to first unread message

Kamil Demecki

unread,
Oct 18, 2024, 9:06:05 AM10/18/24
to RxJava
Hi!

What is the reason that Flowable#subscribe does not have an version to specify request size for the subscription but all use FlowableInternalHelper.RequestMax.INSTANCE.

What is an background that default is not correlated with the default buffer size (128 - like half of that)?

Am I reading API right that to apply backpressure and not loose data / fail with error I need to use something like below and there is not shortcut in the API for that?

        .subscribeWith(
            new DisposableSubscriber<List<Buffer>>() {
              @Override
              public void onStart() {
                request(1);
              }

              @Override
              public void onNext(List<Buffer> buffers) {
                // ...
                request(1);
              }

              @Override
              public void onError(Throwable throwable) {
                // ...
              }

              @Override
              public void onComplete() {
                // ...
              }
            });

I wrote small a rxjava-agent to let me catch easier situation when unbounded subscriptions are used - API is documented but it is easier for me to see what actually happens.

Regards
Kamil

aber...@gmail.com

unread,
Oct 18, 2024, 7:21:45 PM10/18/24
to RxJava
Could you post this question on stackoverflow.com so support and answers can be found by everyone? Reply with the link to the question in SO.

Kamil Demecki

unread,
Oct 22, 2024, 9:03:59 AM10/22/24
to RxJava
Thanks! I posted it here.
Reply all
Reply to author
Forward
0 new messages