Skip to content

Commit 4850c86

Browse files
BlockingObservable Refactor
No longer extends from Observable. If someone chooses to use BlockingObservable the intent is to leave the Observable so it shouldn't show the non-blocking operators. Remove duplicate static methods, similar to how done on Observable in earlier commit.
1 parent a698242 commit 4850c86

File tree

3 files changed

+56
-285
lines changed

3 files changed

+56
-285
lines changed

language-adaptors/rxjava-clojure/src/test/clojure/rx/lang/clojure/interop_test.clj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,16 @@
120120
(.onNext o 99)
121121
(.onCompleted o)
122122
(rx.subscriptions.Subscriptions/empty)))
123-
(BlockingObservable/single)))))
123+
.toBlockingObservable
124+
.single))))
124125

125126
(testing "can pass rx/fn to map and friends"
126127
(is (= (+ 1 4 9)
127128
(-> (Observable/from [1 2 3])
128129
(.map (rx/fn [v] (* v v)))
129130
(.reduce (rx/fn* +))
130-
(BlockingObservable/single)))))
131+
.toBlockingObservable
132+
.single))))
131133

132134
(testing "can pass rx/action to subscribe and friends"
133135
(let [finally-called (atom nil)

language-adaptors/rxjava-groovy/src/test/groovy/rx/lang/groovy/ObservableTests.groovy

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,12 @@ def class ObservableTests {
324324
return Observable.from(1, 3, 2, 5, 4);
325325
}
326326

327-
public TestObservable getObservable() {
328-
return new TestObservable(counter++);
327+
public TestOnSubscribe getOnSubscribe() {
328+
return new TestOnSubscribe(counter++);
329+
}
330+
331+
public Observable getObservable() {
332+
return Observable.create(getOnSubscribe());
329333
}
330334
}
331335

@@ -335,14 +339,14 @@ def class ObservableTests {
335339
public void received(Object o);
336340
}
337341

338-
def class TestObservable extends Observable<String> {
342+
def class TestOnSubscribe implements OnSubscribeFunc<String> {
339343
private final int count;
340344

341-
public TestObservable(int count) {
345+
public TestOnSubscribe(int count) {
342346
this.count = count;
343347
}
344348

345-
public Subscription subscribe(Observer<String> observer) {
349+
public Subscription onSubscribe(Observer<String> observer) {
346350

347351
observer.onNext("hello_" + count);
348352
observer.onCompleted();

0 commit comments

Comments
 (0)