Skip to content
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

Implement the 'Start' operator #594

Merged
merged 3 commits into from
Dec 11, 2013
Merged

Conversation

zsxwing
Copy link
Member

@zsxwing zsxwing commented Dec 9, 2013

Hi, this PR implemented the Start operator #81. Please take a look.

@cloudbees-pull-request-builder

RxJava-pull-requests #528 SUCCESS
This pull request looks good

@samuelgruetter
Copy link
Contributor

Nice! So Observable.start(Func0) might become the new way of creating Futures...
Maybe add some tests which illustrate what happens if I subscribe to Observable.start before/while/after its calculation has terminated, and what happens if there are several subscribers (I think it's correctly implemented, but just to make everything more stable and better documented).

@zsxwing
Copy link
Member Author

zsxwing commented Dec 10, 2013

Thanks, @samuelgruetter , I added more tests. Is it necessary to construct a special test that subscribe and func run at the same time? I think "before" and "after" are enough.

@cloudbees-pull-request-builder

RxJava-pull-requests #533 SUCCESS
This pull request looks good

* or an exception.
* @see <a href="http://msdn.microsoft.com/en-us/library/hh229265(v=vs.103).aspx">MSDN: Observable.Start</a>
*/
public static Observable<Void> start(Action0 action) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we have the Func0 version, do we need this Action0 overload? The issue is that dynamic languages can't differentiate between the two.

If someone truly has a Void returning action (which to me should be a rarity) then they can put Func0<Void>.

I'd recommend we remove the Action0 overloads and only have Func0.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. I removed them.

@cloudbees-pull-request-builder

RxJava-pull-requests #537 SUCCESS
This pull request looks good

benjchristensen added a commit that referenced this pull request Dec 11, 2013
Implement the 'Start' operator
@benjchristensen benjchristensen merged commit 670cee3 into ReactiveX:master Dec 11, 2013
@zsxwing zsxwing deleted the start branch December 11, 2013 06:13
rickbw pushed a commit to rickbw/RxJava that referenced this pull request Jan 9, 2014
Implement the 'Start' operator
jihoonson pushed a commit to jihoonson/RxJava that referenced this pull request Mar 6, 2020
…er are ca… (ReactiveX#594)

* Issue ReactiveX#581: Some RxJava2 or Reactor operators like ZipObserver are cancelling (disposing) a second Observable when the first observable is complete. This is because an operator like zip must combine two events. It makes no sense to consume further events of the second observable when the first is completed. Unfortunately the cancellation is bad for the CircuitBreakerOperator, since no success is recorded even if an emit was emitted successfully. Solution: The CircuitBreaker operator and BulkHead operator could track if an event has been emitted successfully (onNext). And when dispose/cancel is invoked, the operator either invokes onSuccess/onComplete or releasePermission.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants