RxJava



rx.operators
Class OperationThrottleFirst

java.lang.Object
  extended by rx.operators.OperationThrottleFirst

public final class OperationThrottleFirst
extends java.lang.Object

Throttle by windowing a stream and returning the first value in each window.


Constructor Summary
OperationThrottleFirst()
           
 
Method Summary
static
<T> Observable.OnSubscribeFunc<T>
throttleFirst(Observable<T> items, long windowDuration, java.util.concurrent.TimeUnit unit)
          Throttles to first value in each window.
static
<T> Observable.OnSubscribeFunc<T>
throttleFirst(Observable<T> items, long windowDuration, java.util.concurrent.TimeUnit unit, Scheduler scheduler)
          Throttles to first value in each window.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OperationThrottleFirst

public OperationThrottleFirst()
Method Detail

throttleFirst

public static <T> Observable.OnSubscribeFunc<T> throttleFirst(Observable<T> items,
                                                              long windowDuration,
                                                              java.util.concurrent.TimeUnit unit)
Throttles to first value in each window.

Parameters:
items - The Observable which is publishing events.
windowDuration - Duration of windows within with the first value will be chosen.
unit - The unit of time for the specified timeout.
Returns:
A Func1 which performs the throttle operation.

throttleFirst

public static <T> Observable.OnSubscribeFunc<T> throttleFirst(Observable<T> items,
                                                              long windowDuration,
                                                              java.util.concurrent.TimeUnit unit,
                                                              Scheduler scheduler)
Throttles to first value in each window.

Parameters:
items - The Observable which is publishing events.
windowDuration - Duration of windows within with the first value will be chosen.
unit - The unit of time for the specified timeout.
scheduler - The Scheduler to use internally to manage the timers which handle timeout for each event.
Returns:
A Func1 which performs the throttle operation.