Skip to content

Commit

Permalink
Merge pull request #1052 from benjchristensen/computation-scheduler
Browse files Browse the repository at this point in the history
Scheduler Cleanup
  • Loading branch information
benjchristensen committed Apr 20, 2014
2 parents 9f84ecb + 9826fc9 commit d40c868
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions rxjava-core/src/main/java/rx/Observable.java
Original file line number Diff line number Diff line change
Expand Up @@ -5079,9 +5079,7 @@ public final Observable<T> onExceptionResumeNext(final Observable<? extends T> r
* @see <a href="https://github.com/Netflix/RxJava/wiki/Observable-Utility-Operators#wiki-parallel">RxJava Wiki: parallel()</a>
*/
public final <R> Observable<R> parallel(Func1<Observable<T>, Observable<R>> f) {
// TODO move this back to Schedulers.computation() again once that is properly using eventloops
// see https://github.com/Netflix/RxJava/issues/713 for why this was changed
return lift(new OperatorParallel<T, R>(f, Schedulers.newThread()));
return lift(new OperatorParallel<T, R>(f, Schedulers.computation()));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import rx.subscriptions.CompositeSubscription;
import rx.subscriptions.Subscriptions;

/* package */class ComputationScheduler extends Scheduler {
/* package */class EventLoopsScheduler extends Scheduler {

private static class ComputationSchedulerPool {
final int cores = Runtime.getRuntime().availableProcessors();
Expand Down
2 changes: 1 addition & 1 deletion rxjava-core/src/main/java/rx/schedulers/Schedulers.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ private Schedulers() {
if (c != null) {
computationScheduler = c;
} else {
computationScheduler = new ComputationScheduler();
computationScheduler = new EventLoopsScheduler();
}

Scheduler io = RxJavaPlugins.getInstance().getDefaultSchedulers().getIOScheduler();
Expand Down

0 comments on commit d40c868

Please sign in to comment.