From 47d545ad70dbf33b3f00052c1b519394ba52e222 Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Mon, 9 Mar 2020 10:20:38 -0700 Subject: [PATCH] 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. --- api/src/main/java/io/grpc/MethodDescriptor.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/api/src/main/java/io/grpc/MethodDescriptor.java b/api/src/main/java/io/grpc/MethodDescriptor.java index 51c65b08cc..08692592e4 100644 --- a/api/src/main/java/io/grpc/MethodDescriptor.java +++ b/api/src/main/java/io/grpc/MethodDescriptor.java @@ -85,7 +85,7 @@ public final class MethodDescriptor { UNARY, /** - * Zero or more request messages followed by one response message. + * Zero or more request messages with one response message. */ CLIENT_STREAMING, @@ -106,9 +106,8 @@ public final class MethodDescriptor { UNKNOWN; /** - * Returns {@code true} if the client will immediately send one request message to the server - * after calling {@link ClientCall#start(io.grpc.ClientCall.Listener, io.grpc.Metadata)} - * and then immediately half-close the stream by calling {@link io.grpc.ClientCall#halfClose()}. + * Returns {@code true} for {@code UNARY} and {@code SERVER_STREAMING}, which do not permit the + * client to stream. * * @since 1.0.0 */ @@ -117,9 +116,8 @@ public final class MethodDescriptor { } /** - * Returns {@code true} if the server will immediately send one response message to the client - * upon receipt of {@link io.grpc.ServerCall.Listener#onHalfClose()} and then immediately - * close the stream by calling {@link ServerCall#close(Status, io.grpc.Metadata)}. + * Returns {@code true} for {@code UNARY} and {@code CLIENT_STREAMING}, which do not permit the + * server to stream. * * @since 1.0.0 */