-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented the 'Throw' operator with scheduler #416
Conversation
RxJava-pull-requests #324 SUCCESS |
* @see <a href="http://msdn.microsoft.com/en-us/library/hh211711(v=vs.103).aspx">MSDN: Observable.Throw Method</a> | ||
*/ | ||
public static <T> Observable<T> error(Throwable exception, Scheduler scheduler) { | ||
return Observable.<T> error(exception).observeOn(scheduler); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be subscribeOn
instead of observeOn
?
For example, in the other pull request https://github.com/Netflix/RxJava/pull/415/files#diff-5ec494b927739f6fefe3a4d351a9dd05R566 it uses subscribeOn
.
I believe we want subscribeOn
so the actual subscription and callbacks occur on that scheduler instead of observeOn which schedules each notification on a separate scheduler but doesn't change where the work is done.
In this case it has little practical effect as all it does is throw, but I'd like consistency, and subscribeOn
is the more efficient and accurate approach I think?
@benjchristensen I agree with you. I updated the codes and rebased it to master. |
RxJava-pull-requests #338 SUCCESS |
Implemented the 'Throw' operator with scheduler
Implemented the 'Throw' operator with scheduler
…cuit breaker state (ReactiveX#416)
Hi,
I implemented the
Throw
operator #89 with scheduler. I found that RxJava had anerror
method. So I just implemented the scheduler overload.