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: Subject/Processor improvements & small cleanup #4437

Merged
merged 1 commit into from
Aug 29, 2016

Conversation

akarnokd
Copy link
Member

  • open up verifyPositive as protected for validation convenience in subclasses
  • improve size and state handling of DeferredScalarSubscription
  • enable async-fusion on AsyncSubject and AsyncProcessor, compact the classes
  • behavior change AsyncX.hasValue() returns false until the terminal state has been reached
  • compact the classes PublishSubject, PublishProcessor, BehaviorSubject, BehaviorProcessor, ReplaySubject and ReplayProcessor
  • enable async-fusion on UnicastSubject, compact the class
  • rename BaseXQueueDisposable to BasicXQueueDisposable to match BasicXQueueSubscription
  • introduce DeferredScalarDisposable, refactor DeferredScalarObserver
  • adjust tests that asserted on the former parameter names
  • subjects and processors can now be created with newing up their constructor: new PublishSubject<>(); there is no mandatory shared state between the Observer part and the Observable part because both are now stateless on their own.

@codecov-io
Copy link

codecov-io commented Aug 29, 2016

Current coverage is 75.02% (diff: 80.16%)

Merging #4437 into 2.x will decrease coverage by 0.08%

@@                2.x      #4437   diff @@
==========================================
  Files           453        454     +1   
  Lines         32399      32271   -128   
  Methods           0          0          
  Messages          0          0          
  Branches       5216       5208     -8   
==========================================
- Hits          24336      24212   -124   
- Misses         6034       6039     +5   
+ Partials       2029       2020     -9   

Powered by Codecov. Last update f97c50d...09a3448

* @throws IllegalArgumentException if bufferSize &lt;= 0
*/
private static void verifyPositive(int value, String paramName) {
protected static int verifyPositive(int value, String paramName) {
Copy link
Contributor

Choose a reason for hiding this comment

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

These aren't high-value APIs and are trivial to replicate with

if (value < 0) throw new IllegalArgumentException("value < 0: " + value);

I would prefer they be moved somewhere in internal and made public for use all over the library but not be exposed in the library's public API.

Copy link
Member Author

Choose a reason for hiding this comment

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

Next PR?

@JakeWharton
Copy link
Contributor

thanks 👍

@akarnokd akarnokd force-pushed the CleanupAndImprovements829_1 branch from 24740b8 to 09a3448 Compare August 29, 2016 17:07
@akarnokd akarnokd merged commit a856572 into ReactiveX:2.x Aug 29, 2016
@akarnokd akarnokd deleted the CleanupAndImprovements829_1 branch August 29, 2016 18:28
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