Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion stub/src/main/java/io/grpc/stub/CallStreamObserver.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,13 @@ public abstract class CallStreamObserver<V> implements StreamObserver<V> {
* {@code true}. If {@code isReady() == false} the normal expectations apply, so there would be
* <em>another</em> {@code onReadyHandler} callback.
*
* @param onReadyHandler to call when peer is ready to receive more messages.
* <p>Readiness here has the same meaning as for {@link #isReady}: the observer can accept more

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This whole paragraph is good rationale for your PR. It would make sense in the commit description but not so much here as a permanent addition to the javadoc. Readiness is already fully explained above, in the isReady() API contract and the javadoc for this class. Better to leave this API's contract defined in terms of the return value of the isReady() method.

How about just saying:

@param onReadyHandler to call when this observer's isReady() transitions from false to true 

?

* messages without requiring excessive buffering internally. The callback does not distinguish
* whether the capacity became available because the peer requested more messages or because the
* observer had spare buffering capacity of its own.
*
* @param onReadyHandler to call when the observer becomes ready to accept more messages without
* excessive buffering.
*/
public abstract void setOnReadyHandler(Runnable onReadyHandler);

Expand Down
Loading