Skip to content

Commit

Permalink
Merge pull request #3429 from stealthcode/blocking-subscribe
Browse files Browse the repository at this point in the history
Removed the alias BlockingObservable#run
  • Loading branch information
Aaron Tull committed Oct 9, 2015
2 parents c1d3187 + 1385cd8 commit 563fc3f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
10 changes: 1 addition & 9 deletions src/main/java/rx/observables/BlockingObservable.java
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ private void awaitForComplete(CountDownLatch latch, Subscription subscription) {
* Runs the source observable to a terminal event, ignoring any values and rethrowing any exception.
*/
@Experimental
public void run() {
public void subscribe() {
final CountDownLatch cdl = new CountDownLatch(1);
final Throwable[] error = { null };
Subscription s = o.subscribe(new Subscriber<T>() {
Expand Down Expand Up @@ -642,14 +642,6 @@ public void call() {
}
}

/**
* Runs the source observable to a terminal event, ignoring any values and rethrowing any exception.
*/
@Experimental
public void subscribe() {
run();
}

/**
* Subscribes to the source and calls the given action on the current thread and rethrows any exception wrapped
* into OnErrorNotImplementedException.
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/rx/observables/BlockingObservableTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -634,18 +634,18 @@ private InterruptedException getInterruptedExceptionOrNull() {

@Test
public void testRun() {
Observable.just(1).observeOn(Schedulers.computation()).toBlocking().run();
Observable.just(1).observeOn(Schedulers.computation()).toBlocking().subscribe();
}

@Test(expected = TestException.class)
public void testRunException() {
Observable.error(new TestException()).observeOn(Schedulers.computation()).toBlocking().run();
Observable.error(new TestException()).observeOn(Schedulers.computation()).toBlocking().subscribe();
}

@Test
public void testRunIOException() {
try {
Observable.error(new IOException()).observeOn(Schedulers.computation()).toBlocking().run();
Observable.error(new IOException()).observeOn(Schedulers.computation()).toBlocking().subscribe();
fail("No exception thrown");
} catch (RuntimeException ex) {
if (ex.getCause() instanceof IOException) {
Expand Down

0 comments on commit 563fc3f

Please sign in to comment.