Skip to content

Commit

Permalink
api: Clarify expectations regarding ServerCall#close (grpc#7580)
Browse files Browse the repository at this point in the history
  • Loading branch information
ST-DDT authored and dfawley committed Jan 15, 2021
1 parent 6fe9d36 commit 1b601fb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions api/src/main/java/io/grpc/ServerCall.java
Expand Up @@ -163,6 +163,13 @@ public boolean isReady() {
* <p>Since {@link Metadata} is not thread-safe, the caller must not access (read or write) {@code
* trailers} after this point.
*
* <p>This method implies the caller completed processing the RPC, but it does not imply the RPC
* is complete. The call implementation will need additional time to complete the RPC and during
* this time the client is still able to cancel the request or a network error might cause the
* RPC to fail. If you wish to know when the call is actually completed/closed, you have to use
* {@link Listener#onComplete} or {@link Listener#onCancel} instead. This method is not
* necessarily invoked when Listener.onCancel() is called.
*
* @throws IllegalStateException if call is already {@code close}d
*/
public abstract void close(Status status, Metadata trailers);
Expand Down

0 comments on commit 1b601fb

Please sign in to comment.