Skip to content

Commit 47d545a

Browse files
committed
api: Fix MethodType documentation overspecification
The server does not _have_ to wait until half close in CLIENT_STREAMING, and commonly wouldn't in error cases. {client,server}SendsOneMessage were way over-specifying the behavior and included unnecessary and incorrect words like "immediately." Those methods shouldn't be the defining the behavior in that much precision anyway; that would be the job of the individual enum values, if anything.
1 parent b348479 commit 47d545a

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

api/src/main/java/io/grpc/MethodDescriptor.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public enum MethodType {
8585
UNARY,
8686

8787
/**
88-
* Zero or more request messages followed by one response message.
88+
* Zero or more request messages with one response message.
8989
*/
9090
CLIENT_STREAMING,
9191

@@ -106,9 +106,8 @@ public enum MethodType {
106106
UNKNOWN;
107107

108108
/**
109-
* Returns {@code true} if the client will immediately send one request message to the server
110-
* after calling {@link ClientCall#start(io.grpc.ClientCall.Listener, io.grpc.Metadata)}
111-
* and then immediately half-close the stream by calling {@link io.grpc.ClientCall#halfClose()}.
109+
* Returns {@code true} for {@code UNARY} and {@code SERVER_STREAMING}, which do not permit the
110+
* client to stream.
112111
*
113112
* @since 1.0.0
114113
*/
@@ -117,9 +116,8 @@ public final boolean clientSendsOneMessage() {
117116
}
118117

119118
/**
120-
* Returns {@code true} if the server will immediately send one response message to the client
121-
* upon receipt of {@link io.grpc.ServerCall.Listener#onHalfClose()} and then immediately
122-
* close the stream by calling {@link ServerCall#close(Status, io.grpc.Metadata)}.
119+
* Returns {@code true} for {@code UNARY} and {@code CLIENT_STREAMING}, which do not permit the
120+
* server to stream.
123121
*
124122
* @since 1.0.0
125123
*/

0 commit comments

Comments
 (0)