From ae4ee407113a50d6049846f4bee7f2e72c07514d Mon Sep 17 00:00:00 2001 From: Kun Zhang Date: Fri, 4 Sep 2015 14:34:28 -0700 Subject: [PATCH] Fix flow-control documentation on Stream --- core/src/main/java/io/grpc/internal/Stream.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/core/src/main/java/io/grpc/internal/Stream.java b/core/src/main/java/io/grpc/internal/Stream.java index 64687a2471..8c4e157af3 100644 --- a/core/src/main/java/io/grpc/internal/Stream.java +++ b/core/src/main/java/io/grpc/internal/Stream.java @@ -56,12 +56,8 @@ public interface Stream { * {@link io.grpc.KnownLength} to improve efficiency. This method will always return immediately * and will not wait for the write to complete. * - *

- * When the write is "accepted" by the transport, the given callback (if provided) will be called. - * The definition of what it means to be "accepted" is up to the transport implementation, but - * this is a general indication that the transport is capable of handling more out-bound data on - * the stream. If the stream/connection is closed for any reason before the write could be - * accepted, the callback will never be invoked. + *

It is recommended that the caller consult {@link #isReady()} before calling this method to + * avoid excessive buffering in the transport. * * @param message stream containing the serialized message to be sent */ @@ -73,9 +69,11 @@ public interface Stream { void flush(); /** - * If {@code true}, indicates that the transport is capable of sending additional messages - * without requiring excessive buffering internally. This event is - * just a suggestion and the application is free to ignore it, however doing so may + * If {@code true}, indicates that the transport is capable of sending additional messages without + * requiring excessive buffering internally. Otherwise, {@link StreamListener#onReady()} will be + * called when it turns {@code true}. + * + *

This is just a suggestion and the application is free to ignore it, however doing so may * result in excessive buffering within the transport. */ boolean isReady();