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

2.x: add doFinally to the rest of the reactive base classes #4832

Merged
merged 1 commit into from
Nov 10, 2016

Conversation

akarnokd
Copy link
Member

@akarnokd akarnokd commented Nov 10, 2016

This PR adds the doFinally operator to the rest of the base reactive classes.

@akarnokd akarnokd added this to the 2.1 milestone Nov 10, 2016
@codecov-io
Copy link

Current coverage is 95.66% (diff: 98.67%)

Merging #4832 into 2.x will increase coverage by 0.08%

@@                2.x      #4832   diff @@
==========================================
  Files           572        576     +4   
  Lines         36897      37048   +151   
  Methods           0          0          
  Messages          0          0          
  Branches       5578       5591    +13   
==========================================
+ Hits          35267      35442   +175   
+ Misses          677        663    -14   
+ Partials        953        943    -10   

Powered by Codecov. Last update 91d2b93...02e93ee

}

void runFinally() {
if (compareAndSet(0, 1)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there reasoning behind why int over boolean was used?

Copy link
Member Author

Choose a reason for hiding this comment

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

So the pattern stays the same. Internally, AtomicBoolean does the same thing.

Copy link
Contributor

Choose a reason for hiding this comment

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

The half serialization pattern?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is an "enter once" pattern.

@akarnokd akarnokd merged commit 2f8e8bc into ReactiveX:2.x Nov 10, 2016
@akarnokd akarnokd deleted the DoFinallyRest branch November 10, 2016 17:16
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.

3 participants