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.
This commit is contained in:
Eric Anderson 2020-03-09 10:20:38 -07:00 committed by Eric Anderson
parent b348479ac8
commit 47d545ad70
1 changed files with 5 additions and 7 deletions

View File

@ -85,7 +85,7 @@ public final class MethodDescriptor<ReqT, RespT> {
UNARY, UNARY,
/** /**
* Zero or more request messages followed by one response message. * Zero or more request messages with one response message.
*/ */
CLIENT_STREAMING, CLIENT_STREAMING,
@ -106,9 +106,8 @@ public final class MethodDescriptor<ReqT, RespT> {
UNKNOWN; UNKNOWN;
/** /**
* Returns {@code true} if the client will immediately send one request message to the server * Returns {@code true} for {@code UNARY} and {@code SERVER_STREAMING}, which do not permit the
* after calling {@link ClientCall#start(io.grpc.ClientCall.Listener, io.grpc.Metadata)} * client to stream.
* and then immediately half-close the stream by calling {@link io.grpc.ClientCall#halfClose()}.
* *
* @since 1.0.0 * @since 1.0.0
*/ */
@ -117,9 +116,8 @@ public final class MethodDescriptor<ReqT, RespT> {
} }
/** /**
* Returns {@code true} if the server will immediately send one response message to the client * Returns {@code true} for {@code UNARY} and {@code CLIENT_STREAMING}, which do not permit the
* upon receipt of {@link io.grpc.ServerCall.Listener#onHalfClose()} and then immediately * server to stream.
* close the stream by calling {@link ServerCall#close(Status, io.grpc.Metadata)}.
* *
* @since 1.0.0 * @since 1.0.0
*/ */