You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* <dd>You specify which {@link Scheduler} this operator will use.</dd>
17350
+
* <dt><b>Error handling:</b></dt>
17351
+
* <dd>
17352
+
* If the upstream signals an {@code onError} or {@code onDropped} callback crashes,
17353
+
* the error is delivered immediately to the downstream. If both happen, a {@link CompositeException}
17354
+
* is created, containing both the upstream and the callback error.
17355
+
* If the {@code onDropped} callback crashes during cancellation, the exception is forwarded
17356
+
* to the global error handler via {@link RxJavaPlugins#onError(Throwable)}.
17357
+
* </dd>
17358
+
* </dl>
17359
+
* @param timeout the time to wait after an item emission towards the downstream
17360
+
* before trying to emit the latest item from upstream again
17361
+
* @param unit the time unit
17362
+
* @param scheduler the {@code Scheduler} where the timed wait and latest item
17363
+
* emission will be performed
17364
+
* @param emitLast If {@code true}, the very last item from the upstream will be emitted
17365
+
* immediately when the upstream completes, regardless if there is
17366
+
* a timeout window active or not. If {@code false}, the very last
17367
+
* upstream item is ignored and the flow terminates.
17368
+
* @param onDropped called when an item is replaced by a newer item that doesn't get delivered
17369
+
* to the downstream, including the very last item if {@code emitLast} is {@code false}
17370
+
* and the current undelivered item when the sequence gets canceled.
17371
+
* @return the new {@code Flowable} instance
17372
+
* @throws NullPointerException if {@code unit}, {@code scheduler} or {@code onDropped} is {@code null}
17373
+
* @since 3.1.6 - Experimental
17374
+
*/
17375
+
@CheckReturnValue
17376
+
@NonNull
17377
+
@BackpressureSupport(BackpressureKind.ERROR)
17378
+
@SchedulerSupport(SchedulerSupport.CUSTOM)
17379
+
@Experimental
17380
+
public final Flowable<T> throttleLatest(long timeout, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean emitLast, @NonNull Consumer<? super T> onDropped) {
17381
+
Objects.requireNonNull(unit, "unit is null");
17382
+
Objects.requireNonNull(scheduler, "scheduler is null");
17383
+
Objects.requireNonNull(onDropped, "onDropped is null");
17384
+
return RxJavaPlugins.onAssembly(new FlowableThrottleLatest<>(this, timeout, unit, scheduler, emitLast, onDropped));
* If no items were emitted from the upstream during this timeout phase, the next
14376
+
* upstream item is emitted immediately and the timeout window starts from then.
14377
+
* <dl>
14378
+
* <dt><b>Scheduler:</b></dt>
14379
+
* <dd>You specify which {@link Scheduler} this operator will use.</dd>
14380
+
* <dt><b>Error handling:</b></dt>
14381
+
* <dd>
14382
+
* If the upstream signals an {@code onError} or {@code onDropped} callback crashes,
14383
+
* the error is delivered immediately to the downstream. If both happen, a {@link CompositeException}
14384
+
* is created, containing both the upstream and the callback error.
14385
+
* If the {@code onDropped} callback crashes when the sequence gets disposed, the exception is forwarded
14386
+
* to the global error handler via {@link RxJavaPlugins#onError(Throwable)}.
14387
+
* </dd>
14388
+
* </dl>
14389
+
* @param timeout the time to wait after an item emission towards the downstream
14390
+
* before trying to emit the latest item from upstream again
14391
+
* @param unit the time unit
14392
+
* @param scheduler the {@code Scheduler} where the timed wait and latest item
14393
+
* emission will be performed
14394
+
* @param emitLast If {@code true}, the very last item from the upstream will be emitted
14395
+
* immediately when the upstream completes, regardless if there is
14396
+
* a timeout window active or not. If {@code false}, the very last
14397
+
* upstream item is ignored and the flow terminates.
14398
+
* @param onDropped called when an item is replaced by a newer item that doesn't get delivered
14399
+
* to the downstream, including the very last item if {@code emitLast} is {@code false}
14400
+
* and the current undelivered item when the sequence gets disposed.
14401
+
* @return the new {@code Observable} instance
14402
+
* @throws NullPointerException if {@code unit}, {@code scheduler} or {@code onDropped} is {@code null}
14403
+
* @since 3.1.6 - Experimental
14404
+
*/
14405
+
@CheckReturnValue
14406
+
@SchedulerSupport(SchedulerSupport.CUSTOM)
14407
+
@NonNull
14408
+
@Experimental
14409
+
public final Observable<T> throttleLatest(long timeout, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean emitLast, @NonNull Consumer<? super T> onDropped) {
14410
+
Objects.requireNonNull(unit, "unit is null");
14411
+
Objects.requireNonNull(scheduler, "scheduler is null");
14412
+
Objects.requireNonNull(onDropped, "onDropped is null");
14413
+
return RxJavaPlugins.onAssembly(new ObservableThrottleLatest<>(this, timeout, unit, scheduler, emitLast, onDropped));
0 commit comments