Skip to content

Commit 563fc3f

Browse files
author
Aaron Tull
committed
Merge pull request #3429 from stealthcode/blocking-subscribe
Removed the alias BlockingObservable#run
2 parents c1d3187 + 1385cd8 commit 563fc3f

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

src/main/java/rx/observables/BlockingObservable.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ private void awaitForComplete(CountDownLatch latch, Subscription subscription) {
482482
* Runs the source observable to a terminal event, ignoring any values and rethrowing any exception.
483483
*/
484484
@Experimental
485-
public void run() {
485+
public void subscribe() {
486486
final CountDownLatch cdl = new CountDownLatch(1);
487487
final Throwable[] error = { null };
488488
Subscription s = o.subscribe(new Subscriber<T>() {
@@ -642,14 +642,6 @@ public void call() {
642642
}
643643
}
644644

645-
/**
646-
* Runs the source observable to a terminal event, ignoring any values and rethrowing any exception.
647-
*/
648-
@Experimental
649-
public void subscribe() {
650-
run();
651-
}
652-
653645
/**
654646
* Subscribes to the source and calls the given action on the current thread and rethrows any exception wrapped
655647
* into OnErrorNotImplementedException.

src/test/java/rx/observables/BlockingObservableTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -634,18 +634,18 @@ private InterruptedException getInterruptedExceptionOrNull() {
634634

635635
@Test
636636
public void testRun() {
637-
Observable.just(1).observeOn(Schedulers.computation()).toBlocking().run();
637+
Observable.just(1).observeOn(Schedulers.computation()).toBlocking().subscribe();
638638
}
639639

640640
@Test(expected = TestException.class)
641641
public void testRunException() {
642-
Observable.error(new TestException()).observeOn(Schedulers.computation()).toBlocking().run();
642+
Observable.error(new TestException()).observeOn(Schedulers.computation()).toBlocking().subscribe();
643643
}
644644

645645
@Test
646646
public void testRunIOException() {
647647
try {
648-
Observable.error(new IOException()).observeOn(Schedulers.computation()).toBlocking().run();
648+
Observable.error(new IOException()).observeOn(Schedulers.computation()).toBlocking().subscribe();
649649
fail("No exception thrown");
650650
} catch (RuntimeException ex) {
651651
if (ex.getCause() instanceof IOException) {

0 commit comments

Comments
 (0)