diff --git a/rxjava-core/src/main/java/rx/Observable.java b/rxjava-core/src/main/java/rx/Observable.java index e83231ded6e..2e11afc6541 100644 --- a/rxjava-core/src/main/java/rx/Observable.java +++ b/rxjava-core/src/main/java/rx/Observable.java @@ -544,11 +544,30 @@ public static Observable create(OnSubscribeFunc func) { * the type of the items (ostensibly) emitted by the Observable * @return an Observable that returns no data to the {@link Observer} and immediately invokes * the {@link Observer}'s {@link Observer#onCompleted() onCompleted} method + * @see MSDN: Observable.Empty Method */ public static Observable empty() { return from(new ArrayList()); } + /** + * Returns an Observable that emits no data to the {@link Observer} and immediately invokes + * its {@link Observer#onCompleted onCompleted} method with the specified scheduler. + *

+ * + * @param scheduler + * the scheduler to call the {@link Observer#onCompleted onCompleted} method. + * @param + * the type of the items (ostensibly) emitted by the Observable + * @return an Observable that returns no data to the {@link Observer} and immediately invokes + * the {@link Observer}'s {@link Observer#onCompleted() onCompleted} method with + * the specified scheduler. + * @see MSDN: Observable.Empty Method (IScheduler) + */ + public static Observable empty(Scheduler scheduler) { + return Observable.empty().subscribeOn(scheduler); + } + /** * Returns an Observable that invokes an {@link Observer}'s {@link Observer#onError onError} method when the Observer subscribes to it *