Skip to content

Commit 8a8c17b

Browse files
committed
Corrected documentation for Flowable.buffer onError behaviour
1 parent 7867443 commit 8a8c17b

File tree

1 file changed

+60
-34
lines changed

1 file changed

+60
-34
lines changed

src/main/java/io/reactivex/Flowable.java

Lines changed: 60 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5871,8 +5871,9 @@ public final void blockingSubscribe(Subscriber<? super T> subscriber) {
58715871
/**
58725872
* Returns a Flowable that emits buffers of items it collects from the source Publisher. The resulting
58735873
* Publisher emits connected, non-overlapping buffers, each containing {@code count} items. When the source
5874-
* Publisher completes or encounters an error, the resulting Publisher emits the current buffer and
5875-
* propagates the notification from the source Publisher.
5874+
* Publisher completes, the resulting Publisher emits the current buffer and propagates the notification from the
5875+
* source Publisher. Note that if the source Publisher issues an onError notification the event is passed on
5876+
* immediately without first emitting the buffer it is in the process of assembling.
58765877
* <p>
58775878
* <img width="640" height="320" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/buffer3.png" alt="">
58785879
* <dl>
@@ -5900,8 +5901,9 @@ public final Flowable<List<T>> buffer(int count) {
59005901
/**
59015902
* Returns a Flowable that emits buffers of items it collects from the source Publisher. The resulting
59025903
* Publisher emits buffers every {@code skip} items, each containing {@code count} items. When the source
5903-
* Publisher completes or encounters an error, the resulting Publisher emits the current buffer and
5904-
* propagates the notification from the source Publisher.
5904+
* Publisher completes, the resulting Publisher emits the current buffer and propagates the notification from the
5905+
* source Publisher. Note that if the source Publisher issues an onError notification the event is passed on
5906+
* immediately without first emitting the buffer it is in the process of assembling.
59055907
* <p>
59065908
* <img width="640" height="320" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/buffer4.png" alt="">
59075909
* <dl>
@@ -5933,8 +5935,9 @@ public final Flowable<List<T>> buffer(int count, int skip) {
59335935
/**
59345936
* Returns a Flowable that emits buffers of items it collects from the source Publisher. The resulting
59355937
* Publisher emits buffers every {@code skip} items, each containing {@code count} items. When the source
5936-
* Publisher completes or encounters an error, the resulting Publisher emits the current buffer and
5937-
* propagates the notification from the source Publisher.
5938+
* Publisher completes, the resulting Publisher emits the current buffer and propagates the notification from the
5939+
* source Publisher. Note that if the source Publisher issues an onError notification the event is passed on
5940+
* immediately without first emitting the buffer it is in the process of assembling.
59385941
* <p>
59395942
* <img width="640" height="320" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/buffer4.png" alt="">
59405943
* <dl>
@@ -5973,8 +5976,9 @@ public final <U extends Collection<? super T>> Flowable<U> buffer(int count, int
59735976
/**
59745977
* Returns a Flowable that emits buffers of items it collects from the source Publisher. The resulting
59755978
* Publisher emits connected, non-overlapping buffers, each containing {@code count} items. When the source
5976-
* Publisher completes or encounters an error, the resulting Publisher emits the current buffer and
5977-
* propagates the notification from the source Publisher.
5979+
* Publisher completes, the resulting Publisher emits the current buffer and propagates the notification from the
5980+
* source Publisher. Note that if the source Publisher issues an onError notification the event is passed on
5981+
* immediately without first emitting the buffer it is in the process of assembling.
59785982
* <p>
59795983
* <img width="640" height="320" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/buffer3.png" alt="">
59805984
* <dl>
@@ -6007,8 +6011,9 @@ public final <U extends Collection<? super T>> Flowable<U> buffer(int count, Cal
60076011
* Returns a Flowable that emits buffers of items it collects from the source Publisher. The resulting
60086012
* Publisher starts a new buffer periodically, as determined by the {@code timeskip} argument. It emits
60096013
* each buffer after a fixed timespan, specified by the {@code timespan} argument. When the source
6010-
* Publisher completes or encounters an error, the resulting Publisher emits the current buffer and
6011-
* propagates the notification from the source Publisher.
6014+
* Publisher completes, the resulting Publisher emits the current buffer and propagates the notification from the
6015+
* source Publisher. Note that if the source Publisher issues an onError notification the event is passed on
6016+
* immediately without first emitting the buffer it is in the process of assembling.
60126017
* <p>
60136018
* <img width="640" height="320" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/buffer7.png" alt="">
60146019
* <dl>
@@ -6040,8 +6045,10 @@ public final Flowable<List<T>> buffer(long timespan, long timeskip, TimeUnit uni
60406045
* Returns a Flowable that emits buffers of items it collects from the source Publisher. The resulting
60416046
* Publisher starts a new buffer periodically, as determined by the {@code timeskip} argument, and on the
60426047
* specified {@code scheduler}. It emits each buffer after a fixed timespan, specified by the
6043-
* {@code timespan} argument. When the source Publisher completes or encounters an error, the resulting
6044-
* Publisher emits the current buffer and propagates the notification from the source Publisher.
6048+
* {@code timespan} argument. When the source Publisher completes, the resulting Publisher emits the current buffer
6049+
* and propagates the notification from the source Publisher. Note that if the source Publisher issues an onError
6050+
* notification the event is passed on immediately without first emitting the buffer it is in the process of
6051+
* assembling.
60456052
* <p>
60466053
* <img width="640" height="320" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/buffer7.s.png" alt="">
60476054
* <dl>
@@ -6075,8 +6082,10 @@ public final Flowable<List<T>> buffer(long timespan, long timeskip, TimeUnit uni
60756082
* Returns a Flowable that emits buffers of items it collects from the source Publisher. The resulting
60766083
* Publisher starts a new buffer periodically, as determined by the {@code timeskip} argument, and on the
60776084
* specified {@code scheduler}. It emits each buffer after a fixed timespan, specified by the
6078-
* {@code timespan} argument. When the source Publisher completes or encounters an error, the resulting
6079-
* Publisher emits the current buffer and propagates the notification from the source Publisher.
6085+
* {@code timespan} argument. When the source Publisher completes, the resulting Publisher emits the current buffer
6086+
* and propagates the notification from the source Publisher. Note that if the source Publisher issues an onError
6087+
* notification the event is passed on immediately without first emitting the buffer it is in the process of
6088+
* assembling.
60806089
* <p>
60816090
* <img width="640" height="320" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/buffer7.s.png" alt="">
60826091
* <dl>
@@ -6117,8 +6126,10 @@ public final <U extends Collection<? super T>> Flowable<U> buffer(long timespan,
61176126
/**
61186127
* Returns a Flowable that emits buffers of items it collects from the source Publisher. The resulting
61196128
* Publisher emits connected, non-overlapping buffers, each of a fixed duration specified by the
6120-
* {@code timespan} argument. When the source Publisher completes or encounters an error, the resulting
6121-
* Publisher emits the current buffer and propagates the notification from the source Publisher.
6129+
* {@code timespan} argument. When the source Publisher completes, the resulting Publisher emits the current buffer
6130+
* and propagates the notification from the source Publisher. Note that if the source Publisher issues an onError
6131+
* notification the event is passed on immediately without first emitting the buffer it is in the process of
6132+
* assembling.
61226133
* <p>
61236134
* <img width="640" height="320" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/buffer5.png" alt="">
61246135
* <dl>
@@ -6149,8 +6160,9 @@ public final Flowable<List<T>> buffer(long timespan, TimeUnit unit) {
61496160
* Returns a Flowable that emits buffers of items it collects from the source Publisher. The resulting
61506161
* Publisher emits connected, non-overlapping buffers, each of a fixed duration specified by the
61516162
* {@code timespan} argument or a maximum size specified by the {@code count} argument (whichever is reached
6152-
* first). When the source Publisher completes or encounters an error, the resulting Publisher emits the
6153-
* current buffer and propagates the notification from the source Publisher.
6163+
* first). When the source Publisher completes, the resulting Publisher emits the current buffer and propagates the
6164+
* notification from the source Publisher. Note that if the source Publisher issues an onError notification the event
6165+
* is passed on immediately without first emitting the buffer it is in the process of assembling.
61546166
* <p>
61556167
* <img width="640" height="320" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/buffer6.png" alt="">
61566168
* <dl>
@@ -6184,9 +6196,10 @@ public final Flowable<List<T>> buffer(long timespan, TimeUnit unit, int count) {
61846196
* Returns a Flowable that emits buffers of items it collects from the source Publisher. The resulting
61856197
* Publisher emits connected, non-overlapping buffers, each of a fixed duration specified by the
61866198
* {@code timespan} argument as measured on the specified {@code scheduler}, or a maximum size specified by
6187-
* the {@code count} argument (whichever is reached first). When the source Publisher completes or
6188-
* encounters an error, the resulting Publisher emits the current buffer and propagates the notification
6189-
* from the source Publisher.
6199+
* the {@code count} argument (whichever is reached first). When the source Publisher completes, the resulting
6200+
* Publisher emits the current buffer and propagates the notification from the source Publisher. Note that if the
6201+
* source Publisher issues an onError notification the event is passed on immediately without first emitting the
6202+
* buffer it is in the process of assembling.
61906203
* <p>
61916204
* <img width="640" height="320" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/buffer6.s.png" alt="">
61926205
* <dl>
@@ -6222,9 +6235,10 @@ public final Flowable<List<T>> buffer(long timespan, TimeUnit unit, Scheduler sc
62226235
* Returns a Flowable that emits buffers of items it collects from the source Publisher. The resulting
62236236
* Publisher emits connected, non-overlapping buffers, each of a fixed duration specified by the
62246237
* {@code timespan} argument as measured on the specified {@code scheduler}, or a maximum size specified by
6225-
* the {@code count} argument (whichever is reached first). When the source Publisher completes or
6226-
* encounters an error, the resulting Publisher emits the current buffer and propagates the notification
6227-
* from the source Publisher.
6238+
* the {@code count} argument (whichever is reached first). When the source Publisher completes, the resulting
6239+
* Publisher emits the current buffer and propagates the notification from the source Publisher. Note that if the
6240+
* source Publisher issues an onError notification the event is passed on immediately without first emitting the
6241+
* buffer it is in the process of assembling.
62286242
* <p>
62296243
* <img width="640" height="320" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/buffer6.s.png" alt="">
62306244
* <dl>
@@ -6273,9 +6287,10 @@ public final <U extends Collection<? super T>> Flowable<U> buffer(
62736287
/**
62746288
* Returns a Flowable that emits buffers of items it collects from the source Publisher. The resulting
62756289
* Publisher emits connected, non-overlapping buffers, each of a fixed duration specified by the
6276-
* {@code timespan} argument and on the specified {@code scheduler}. When the source Publisher completes or
6277-
* encounters an error, the resulting Publisher emits the current buffer and propagates the notification
6278-
* from the source Publisher.
6290+
* {@code timespan} argument and on the specified {@code scheduler}. When the source Publisher completes, the
6291+
* resulting Publisher emits the current buffer and propagates the notification from the source Publisher. Note that
6292+
* if the source Publisher issues an onError notification the event is passed on immediately without first emitting
6293+
* the buffer it is in the process of assembling.
62796294
* <p>
62806295
* <img width="640" height="320" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/buffer5.s.png" alt="">
62816296
* <dl>
@@ -6307,7 +6322,9 @@ public final Flowable<List<T>> buffer(long timespan, TimeUnit unit, Scheduler sc
63076322
/**
63086323
* Returns a Flowable that emits buffers of items it collects from the source Publisher. The resulting
63096324
* Publisher emits buffers that it creates when the specified {@code openingIndicator} Publisher emits an
6310-
* item, and closes when the Publisher returned from {@code closingIndicator} emits an item.
6325+
* item, and closes when the Publisher returned from {@code closingIndicator} emits an item. If any of the source
6326+
* Publisher, {@code openingIndicator} or {@code closingIndicator} issues an onError notification the event is passed
6327+
* on immediately without first emitting the buffer it is in the process of assembling.
63116328
* <p>
63126329
* <img width="640" height="470" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/buffer2.png" alt="">
63136330
* <dl>
@@ -6341,7 +6358,9 @@ public final <TOpening, TClosing> Flowable<List<T>> buffer(
63416358
/**
63426359
* Returns a Flowable that emits buffers of items it collects from the source Publisher. The resulting
63436360
* Publisher emits buffers that it creates when the specified {@code openingIndicator} Publisher emits an
6344-
* item, and closes when the Publisher returned from {@code closingIndicator} emits an item.
6361+
* item, and closes when the Publisher returned from {@code closingIndicator} emits an item. If any of the source
6362+
* Publisher, {@code openingIndicator} or {@code closingIndicator} issues an onError notification the event is passed
6363+
* on immediately without first emitting the buffer it is in the process of assembling.
63456364
* <p>
63466365
* <img width="640" height="470" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/buffer2.png" alt="">
63476366
* <dl>
@@ -6387,7 +6406,8 @@ public final <TOpening, TClosing, U extends Collection<? super T>> Flowable<U> b
63876406
* <img width="640" height="395" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/buffer8.png" alt="">
63886407
* <p>
63896408
* Completion of either the source or the boundary Publisher causes the returned Publisher to emit the
6390-
* latest buffer and complete.
6409+
* latest buffer and complete. If either the source Publisher or the boundary Publisher issues an onError notification
6410+
* the event is passed on immediately without first emitting the buffer it is in the process of assembling.
63916411
* <dl>
63926412
* <dt><b>Backpressure:</b></dt>
63936413
* <dd>This operator does not support backpressure as it is instead controlled by the {@code Publisher}
@@ -6420,7 +6440,8 @@ public final <B> Flowable<List<T>> buffer(Publisher<B> boundaryIndicator) {
64206440
* <img width="640" height="395" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/buffer8.png" alt="">
64216441
* <p>
64226442
* Completion of either the source or the boundary Publisher causes the returned Publisher to emit the
6423-
* latest buffer and complete.
6443+
* latest buffer and complete. If either the source Publisher or the boundary Publisher issues an onError notification
6444+
* the event is passed on immediately without first emitting the buffer it is in the process of assembling.
64246445
* <dl>
64256446
* <dt><b>Backpressure:</b></dt>
64266447
* <dd>This operator does not support backpressure as it is instead controlled by the {@code Publisher}
@@ -6456,7 +6477,8 @@ public final <B> Flowable<List<T>> buffer(Publisher<B> boundaryIndicator, final
64566477
* <img width="640" height="395" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/buffer8.png" alt="">
64576478
* <p>
64586479
* Completion of either the source or the boundary Publisher causes the returned Publisher to emit the
6459-
* latest buffer and complete.
6480+
* latest buffer and complete. If either the source Publisher or the boundary Publisher issues an onError notification
6481+
* the event is passed on immediately without first emitting the buffer it is in the process of assembling.
64606482
* <dl>
64616483
* <dt><b>Backpressure:</b></dt>
64626484
* <dd>This operator does not support backpressure as it is instead controlled by the {@code Publisher}
@@ -6491,10 +6513,12 @@ public final <B, U extends Collection<? super T>> Flowable<U> buffer(Publisher<B
64916513
/**
64926514
* Returns a Flowable that emits buffers of items it collects from the source Publisher. The resulting
64936515
* Publisher emits connected, non-overlapping buffers. It emits the current buffer and replaces it with a
6494-
* new buffer whenever the Publisher produced by the specified {@code closingIndicator} emits an item.
6516+
* new buffer whenever the Publisher produced by the specified {@code boundaryIndicatorSupplier} emits an item.
64956517
* <p>
64966518
* <img width="640" height="395" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/buffer1.png" alt="">
64976519
* <dl>
6520+
* If either the source Publisher or the boundary Publisher issues an onError notification the event is passed on
6521+
* immediately without first emitting the buffer it is in the process of assembling.
64986522
* <dt><b>Backpressure:</b></dt>
64996523
* <dd>This operator does not support backpressure as it is instead controlled by the given Publishers and
65006524
* buffers data. It requests {@code Long.MAX_VALUE} upstream and does not obey downstream requests.</dd>
@@ -6522,10 +6546,12 @@ public final <B> Flowable<List<T>> buffer(Callable<? extends Publisher<B>> bound
65226546
/**
65236547
* Returns a Flowable that emits buffers of items it collects from the source Publisher. The resulting
65246548
* Publisher emits connected, non-overlapping buffers. It emits the current buffer and replaces it with a
6525-
* new buffer whenever the Publisher produced by the specified {@code closingIndicator} emits an item.
6549+
* new buffer whenever the Publisher produced by the specified {@code boundaryIndicatorSupplier} emits an item.
65266550
* <p>
65276551
* <img width="640" height="395" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/buffer1.png" alt="">
65286552
* <dl>
6553+
* If either the source Publisher or the boundary Publisher issues an onError notification the event is passed on
6554+
* immediately without first emitting the buffer it is in the process of assembling.
65296555
* <dt><b>Backpressure:</b></dt>
65306556
* <dd>This operator does not support backpressure as it is instead controlled by the given Publishers and
65316557
* buffers data. It requests {@code Long.MAX_VALUE} upstream and does not obey downstream requests.</dd>

0 commit comments

Comments
 (0)