Skip to content

Commit

Permalink
clarify CloseSend vs CloseAndRecv; better formatting (#2071)
Browse files Browse the repository at this point in the history
clarify CloseSend vs CloseAndRecv; better formatting
  • Loading branch information
jeanbza authored May 29, 2018
1 parent bd7f82c commit bfe4197
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,13 @@ type ClientStream interface {
// To ensure resources are not leaked due to the stream returned, one of the following
// actions must be performed:
//
// 1. call Close on the ClientConn,
// 2. cancel the context provided,
// 3. call RecvMsg until a non-nil error is returned, or
// 4. receive a non-nil, non-io.EOF error from Header or SendMsg.
// 1. Call Close on the ClientConn.
// 2. Cancel the context provided.
// 3. Call RecvMsg until a non-nil error is returned. A protobuf-generated
// client-streaming RPC, for instance, might use the helper function
// CloseAndRecv (note that CloseSend does not Recv, therefore is not
// guaranteed to release all resources).
// 4. Receive a non-nil, non-io.EOF error from Header or SendMsg.
//
// If none of the above happen, a goroutine and a context will be leaked, and grpc
// will not call the optionally-configured stats handler with a stats.End message.
Expand Down

0 comments on commit bfe4197

Please sign in to comment.