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

Javadoc : Explain explicitly about using Emitter interface methods synchronously #6305

Merged
merged 1 commit into from
Nov 13, 2018

Conversation

punitda
Copy link
Contributor

@punitda punitda commented Nov 13, 2018

Add note in Javadoc explicitly explaining about using Emitter interface methods synchronously.

  • Add notes for generate methods in Observable and Flowable.
  • Plus, add the similar note to Emitter interface.

Resolves: #6299

Copy link
Member

@akarnokd akarnokd left a comment

Choose a reason for hiding this comment

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

Thanks, could you rephrase all the sentences based on my suggestions in the comments?

@@ -17,6 +17,11 @@
/**
* Base interface for emitting signals in a push-fashion in various generator-like source
* operators (create, generate).
* <p>
* Note that the {@link Emitter#onNext}, {@link Emitter#onError} and
* {@link Emitter#onComplete} methods provided to the function should be called synchronously,
Copy link
Member

Choose a reason for hiding this comment

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

"methods provided to the function via the {@link Emitter} instance should be"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@@ -2210,6 +2210,11 @@ public static int bufferSize() {

/**
* Returns a cold, synchronous, stateless and backpressure-aware generator of values.
* <p>
* Note that the {@link Emitter#onNext}, {@link Emitter#onError} and
* {@link Emitter#onComplete} methods provided to the function should be called synchronously,
Copy link
Member

Choose a reason for hiding this comment

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

"methods provided to the function via the {@link Emitter} instance should be"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

* <p>
* Note that the {@link Emitter#onNext}, {@link Emitter#onError} and
* {@link Emitter#onComplete} methods provided to the function should be called synchronously,
* never concurrently and only while the method is executing. Calling them from multiple threads
Copy link
Member

Choose a reason for hiding this comment

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

"while the function body is executing."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@codecov
Copy link

codecov bot commented Nov 13, 2018

Codecov Report

Merging #6305 into 2.x will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##                2.x    #6305      +/-   ##
============================================
+ Coverage     98.25%   98.26%   +<.01%     
+ Complexity     6284     6283       -1     
============================================
  Files           672      672              
  Lines         44992    44992              
  Branches       6223     6223              
============================================
+ Hits          44208    44211       +3     
+ Misses          248      243       -5     
- Partials        536      538       +2
Impacted Files Coverage Δ Complexity Δ
src/main/java/io/reactivex/Flowable.java 100% <ø> (ø) 567 <0> (ø) ⬇️
src/main/java/io/reactivex/Observable.java 100% <ø> (ø) 542 <0> (ø) ⬇️
.../operators/observable/ObservableFlatMapSingle.java 88.8% <0%> (-5.23%) 2% <0%> (ø)
...tivex/internal/schedulers/TrampolineScheduler.java 96.1% <0%> (-2.6%) 6% <0%> (ø)
.../internal/disposables/ListCompositeDisposable.java 98% <0%> (-2%) 34% <0%> (-1%)
...rnal/operators/observable/ObservableSwitchMap.java 94.68% <0%> (-1.6%) 3% <0%> (ø)
...io/reactivex/subscribers/SerializedSubscriber.java 98.86% <0%> (-1.14%) 26% <0%> (-1%)
...ernal/operators/flowable/FlowableFromIterable.java 94.11% <0%> (-1.07%) 5% <0%> (ø)
...operators/observable/ObservableMergeWithMaybe.java 99.1% <0%> (-0.9%) 2% <0%> (ø)
...perators/single/SingleFlatMapIterableFlowable.java 97.5% <0%> (-0.84%) 2% <0%> (ø)
... and 22 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6afd2b8...b971d56. Read the comment docs.

@punitda punitda force-pushed the emitter-methods-javadocs-change branch from aaeddd4 to b971d56 Compare November 13, 2018 13:54
@akarnokd akarnokd merged commit e82b82e into ReactiveX:2.x Nov 13, 2018
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