File tree 1 file changed +19
-0
lines changed
rxjava-core/src/main/java/rx
1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -544,11 +544,30 @@ public static <T> Observable<T> create(OnSubscribeFunc<T> func) {
544
544
* the type of the items (ostensibly) emitted by the Observable
545
545
* @return an Observable that returns no data to the {@link Observer} and immediately invokes
546
546
* the {@link Observer}'s {@link Observer#onCompleted() onCompleted} method
547
+ * @see <a href="http://msdn.microsoft.com/en-us/library/hh229670(v=vs.103).aspx">MSDN: Observable.Empty Method</a>
547
548
*/
548
549
public static <T > Observable <T > empty () {
549
550
return from (new ArrayList <T >());
550
551
}
551
552
553
+ /**
554
+ * Returns an Observable that emits no data to the {@link Observer} and immediately invokes
555
+ * its {@link Observer#onCompleted onCompleted} method with the specified scheduler.
556
+ * <p>
557
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/empty.png">
558
+ * @param scheduler
559
+ * the scheduler to call the {@link Observer#onCompleted onCompleted} method.
560
+ * @param <T>
561
+ * the type of the items (ostensibly) emitted by the Observable
562
+ * @return an Observable that returns no data to the {@link Observer} and immediately invokes
563
+ * the {@link Observer}'s {@link Observer#onCompleted() onCompleted} method with
564
+ * the specified scheduler.
565
+ * @see <a href="http://msdn.microsoft.com/en-us/library/hh229066(v=vs.103).aspx">MSDN: Observable.Empty Method (IScheduler)</a>
566
+ */
567
+ public static <T > Observable <T > empty (Scheduler scheduler ) {
568
+ return Observable .<T >empty ().subscribeOn (scheduler );
569
+ }
570
+
552
571
/**
553
572
* Returns an Observable that invokes an {@link Observer}'s {@link Observer#onError onError} method when the Observer subscribes to it
554
573
* <p>
You can’t perform that action at this time.
0 commit comments