|
37 | 37 | import rx.operators.OperationFilter;
|
38 | 38 | import rx.operators.OperationFinally;
|
39 | 39 | import rx.operators.OperationGroupBy;
|
| 40 | +import rx.operators.OperationInterval; |
40 | 41 | import rx.operators.OperationMap;
|
41 | 42 | import rx.operators.OperationMaterialize;
|
42 | 43 | import rx.operators.OperationMerge;
|
@@ -830,6 +831,35 @@ public static <T> Observable<T> synchronize(Observable<? extends T> observable)
|
830 | 831 | return create(OperationSynchronize.synchronize(observable));
|
831 | 832 | }
|
832 | 833 |
|
| 834 | + |
| 835 | + /** |
| 836 | + * Emits an item each time interval (containing a sequential number). |
| 837 | + * @param interval |
| 838 | + * Interval size in time units (see below). |
| 839 | + * @param unit |
| 840 | + * Time units to use for the interval size. |
| 841 | + * @return An Observable that emits an item each time interval. |
| 842 | + * @see <a href="http://msdn.microsoft.com/en-us/library/hh229027%28v=vs.103%29.aspx">MSDN: Observable.Interval</a> |
| 843 | + */ |
| 844 | + public static Observable<Long> interval(long interval, TimeUnit unit) { |
| 845 | + return create(OperationInterval.interval(interval, unit)); |
| 846 | + } |
| 847 | + |
| 848 | + /** |
| 849 | + * Emits an item each time interval (containing a sequential number). |
| 850 | + * @param interval |
| 851 | + * Interval size in time units (see below). |
| 852 | + * @param unit |
| 853 | + * Time units to use for the interval size. |
| 854 | + * @param scheduler |
| 855 | + * The scheduler to use for scheduling the items. |
| 856 | + * @return An Observable that emits an item each time interval. |
| 857 | + * @see <a href="http://msdn.microsoft.com/en-us/library/hh228911%28v=vs.103%29.aspx">MSDN: Observable.Interval</a> |
| 858 | + */ |
| 859 | + public static Observable<Long> interval(long interval, TimeUnit unit, Scheduler scheduler) { |
| 860 | + return create(OperationInterval.interval(interval, unit, scheduler)); |
| 861 | + } |
| 862 | + |
833 | 863 | /**
|
834 | 864 | * Wraps each item emitted by a source Observable in a {@link Timestamped} object.
|
835 | 865 | * <p>
|
|
0 commit comments