|
91 | 91 | import rx.operators.OperationThrottleFirst;
|
92 | 92 | import rx.operators.OperationTimeInterval;
|
93 | 93 | import rx.operators.OperationTimeout;
|
| 94 | +import rx.operators.OperationTimer; |
94 | 95 | import rx.operators.OperationTimestamp;
|
95 | 96 | import rx.operators.OperationToMap;
|
96 | 97 | import rx.operators.OperationToMultimap;
|
@@ -1990,6 +1991,33 @@ public static Observable<Long> interval(long interval, TimeUnit unit, Scheduler
|
1990 | 1991 | return create(OperationInterval.interval(interval, unit, scheduler));
|
1991 | 1992 | }
|
1992 | 1993 |
|
| 1994 | + /** |
| 1995 | + * Emits one item after a given delay, and then completes. |
| 1996 | + * |
| 1997 | + * @param interval |
| 1998 | + * interval size in time units |
| 1999 | + * @param unit |
| 2000 | + * time units to use for the interval size |
| 2001 | + */ |
| 2002 | + public static Observable<Void> timer(long interval, TimeUnit unit) { |
| 2003 | + return create(OperationTimer.timer(interval, unit)); |
| 2004 | + } |
| 2005 | + |
| 2006 | + /** |
| 2007 | + * Emits one item after a given delay, and then completes. |
| 2008 | + * |
| 2009 | + * @param interval |
| 2010 | + * interval size in time units |
| 2011 | + * @param unit |
| 2012 | + * time units to use for the interval size |
| 2013 | + * @param scheduler |
| 2014 | + * the scheduler to use for scheduling the item |
| 2015 | + */ |
| 2016 | + public static Observable<Void> timer(long interval, TimeUnit unit, |
| 2017 | + Scheduler scheduler) { |
| 2018 | + return create(OperationTimer.timer(interval, unit, scheduler)); |
| 2019 | + } |
| 2020 | + |
1993 | 2021 | /**
|
1994 | 2022 | * Drops items emitted by an Observable that are followed by newer items
|
1995 | 2023 | * before a timeout value expires. The timer resets on each emission.
|
|
0 commit comments