Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 566f16e

Browse files
authored
api: Clarify expectations regarding ServerCall#close (#7580)
1 parent df9c235 commit 566f16e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,13 @@ public boolean isReady() {
163163
* <p>Since {@link Metadata} is not thread-safe, the caller must not access (read or write) {@code
164164
* trailers} after this point.
165165
*
166+
* <p>This method implies the caller completed processing the RPC, but it does not imply the RPC
167+
* is complete. The call implementation will need additional time to complete the RPC and during
168+
* this time the client is still able to cancel the request or a network error might cause the
169+
* RPC to fail. If you wish to know when the call is actually completed/closed, you have to use
170+
* {@link Listener#onComplete} or {@link Listener#onCancel} instead. This method is not
171+
* necessarily invoked when Listener.onCancel() is called.
172+
*
166173
* @throws IllegalStateException if call is already {@code close}d
167174
*/
168175
public abstract void close(Status status, Metadata trailers);

0 commit comments

Comments
 (0)