From ea575d0911b6b98b1b4ab537a97c6c56e26f96d9 Mon Sep 17 00:00:00 2001 From: zsxwing Date: Thu, 26 Sep 2013 09:40:18 +0800 Subject: [PATCH 1/3] Merge branch 'master', remote-tracking branch 'origin' From 5e6e1a55d87bc28c5c7cca8cc4be31ef01dbfcf2 Mon Sep 17 00:00:00 2001 From: zsxwing Date: Mon, 30 Sep 2013 10:56:30 +0800 Subject: [PATCH 2/3] Implemented the 'Empty' operator with scheduler --- rxjava-core/src/main/java/rx/Observable.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/rxjava-core/src/main/java/rx/Observable.java b/rxjava-core/src/main/java/rx/Observable.java index 5a0f668dc5..a28554393e 100644 --- a/rxjava-core/src/main/java/rx/Observable.java +++ b/rxjava-core/src/main/java/rx/Observable.java @@ -547,6 +547,23 @@ 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. + */ + 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 *

From 7f3210a9968606b45f21580043700543d4e0d155 Mon Sep 17 00:00:00 2001 From: zsxwing Date: Mon, 30 Sep 2013 13:58:19 +0800 Subject: [PATCH 3/3] Added MSDN links --- rxjava-core/src/main/java/rx/Observable.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rxjava-core/src/main/java/rx/Observable.java b/rxjava-core/src/main/java/rx/Observable.java index a28554393e..51a0ded03b 100644 --- a/rxjava-core/src/main/java/rx/Observable.java +++ b/rxjava-core/src/main/java/rx/Observable.java @@ -542,6 +542,7 @@ 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()); @@ -559,6 +560,7 @@ public static Observable empty() { * @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);