Skip to content

Add Single.finallyDo() #3434

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

Merged
merged 1 commit into from
Dec 9, 2015
Merged

Conversation

artem-zinnatullin
Copy link
Contributor

@akarnokd I've found a problem with null action, I'll create separate issue about this soon.

@akarnokd
Copy link
Member

Could you verify what happens ig the callback throws?

One should check null in assembly time (i.e. when calling Single.finallyDo.

@artem-zinnatullin
Copy link
Contributor Author

@akarnokd unfortunately very bad thing happens — not only this exception will be swallowed, but also finallyAction executed twice… I'm investigating this and will create issue soon.

@akarnokd
Copy link
Member

👍

@abersnaze
Copy link
Contributor

um... I just noticed that we doOnTerminate and finallyDo on Observable.

the number of methods is too damn high

Could we make this look like doOn*()?

@JakeWharton
Copy link
Contributor

doOnTerminate happens before subscriber notification. finallyDo happens after.

@artem-zinnatullin
Copy link
Contributor Author

Rebased

@akarnokd
Copy link
Member

It can be called doOnAfterComplete() but since finallyDo is established, I'm not sure this rename can happen for 1.0.x.

@stealthcode
Copy link

I'd rather it were called doAfterComplete. finallyDo only exists for the Observable and it doesnt follow the do* convention. We could choose to have 2 conventions (naming Single's variant similarly) or deprecate Observable#finallyDo and create Observable#doAfterComplete. I vote for the latter naming them both doAfterComplete.

@JakeWharton
Copy link
Contributor

I think it would have to be doAfterTermination since it runs on both
complete and error.

On Sat, Oct 17, 2015, 2:45 PM Aaron Tull [email protected] wrote:

I'd rather it were called doAfterComplete. finallyDo only exists for the
Observable and it doesnt follow the do* convention. We could choose to have
2 conventions (naming Single's variant similarly) or deprecate
Observable#finallyDo and create Observable#doAfterComplete. I vote for the
latter naming them both doAfterComplete.


Reply to this email directly or view it on GitHub
#3434 (comment).

@stealthcode
Copy link

Does anyone have any objection to creating Observable.doAfterTermination as an alias for finallyDo and deprecating the original finallyDo? If that's acceptable then this PR should name it Single.doAfterTermination.

@akarnokd
Copy link
Member

akarnokd commented Dec 5, 2015

👍 doAfterTermination

@davidmoten
Copy link
Collaborator

A bit of consistency in tenses would be nice though.

We have

doOnCompleted
doOnTerminate
doOnSubscribe
doOnRequest
...

doOnCompleted is the odd one out but may as well live with that. To be consistent call the method in question doAfterTerminate or doAfterTerminated?

@stealthcode
Copy link

I think doAfterTerminate sounds best to me. It's consistent with the
onComplete of 2.x

On Sat, Dec 5, 2015, 01:53 Dave Moten [email protected] wrote:

A bit of consistency in tenses would be nice though.

We have

doOnCompleted
doOnTerminate
doOnSubscribe
doOnRequest
...

doOnCompleted is the odd one out but may as well live with that. To be
consistent call the method in question doAfterTerminate or
doAfterTerminated?


Reply to this email directly or view it on GitHub
#3434 (comment).

@artem-zinnatullin
Copy link
Contributor Author

Renamed to doAfterTerminate & rebased, PTAL.

@stealthcode
Copy link

Does anyone have any objection to creating Observable.doAfterTermination as an alias for finallyDo and deprecating the original finallyDo?

@artem-zinnatullin would you like to deprecate finallyDo -> doAfterTerminate in this PR?

@artem-zinnatullin
Copy link
Contributor Author

I'd prepare a separate PR after this if you don't mind.

On Mon, Dec 7, 2015, 23:13 Aaron Tull [email protected] wrote:

Does anyone have any objection to creating Observable.doAfterTermination
as an alias for finallyDo and deprecating the original finallyDo?

@artem-zinnatullin https://github.com/artem-zinnatullin would you like
to deprecate finallyDo -> doAfterTerminate in this PR?


Reply to this email directly or view it on GitHub
#3434 (comment).

@artem_zin

@stealthcode
Copy link

Rebase please so we can merge.

@artem-zinnatullin
Copy link
Contributor Author

Rebased!

@stealthcode
Copy link

👍

@akarnokd
Copy link
Member

akarnokd commented Dec 9, 2015

👍

akarnokd added a commit that referenced this pull request Dec 9, 2015
@akarnokd akarnokd merged commit 150e1e8 into ReactiveX:1.x Dec 9, 2015
@stevegury
Copy link
Member

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants