Skip to content

Commit d71f681

Browse files
committed
docs: clarify SendMsg/CloseSend usage
1 parent f86585f commit d71f681

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: stream.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ type ClientStream interface {
8282
// stream.Recv has returned a non-nil error (including io.EOF).
8383
Trailer() metadata.MD
8484
// CloseSend closes the send direction of the stream. It closes the stream
85-
// when non-nil error is met.
85+
// when non-nil error is met. It is also not safe to call CloseSend
86+
// concurrently with SendMsg.
8687
CloseSend() error
8788
// Context returns the context for this stream.
8889
//
@@ -105,7 +106,8 @@ type ClientStream interface {
105106
//
106107
// It is safe to have a goroutine calling SendMsg and another goroutine
107108
// calling RecvMsg on the same stream at the same time, but it is not safe
108-
// to call SendMsg on the same stream in different goroutines.
109+
// to call SendMsg on the same stream in different goroutines. It is also
110+
// not safe to call CloseSend concurrently with SendMsg.
109111
SendMsg(m interface{}) error
110112
// RecvMsg blocks until it receives a message into m or the stream is
111113
// done. It returns io.EOF when the stream completes successfully. On

0 commit comments

Comments
 (0)