Skip to content

Commit 61c3ec8

Browse files
authored
docs: clarify SendMsg/CloseSend usage (#2418)
1 parent 105f614 commit 61c3ec8

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
@@ -86,7 +86,8 @@ type ClientStream interface {
8686
// stream.Recv has returned a non-nil error (including io.EOF).
8787
Trailer() metadata.MD
8888
// CloseSend closes the send direction of the stream. It closes the stream
89-
// when non-nil error is met.
89+
// when non-nil error is met. It is also not safe to call CloseSend
90+
// concurrently with SendMsg.
9091
CloseSend() error
9192
// Context returns the context for this stream.
9293
//
@@ -109,7 +110,8 @@ type ClientStream interface {
109110
//
110111
// It is safe to have a goroutine calling SendMsg and another goroutine
111112
// calling RecvMsg on the same stream at the same time, but it is not safe
112-
// to call SendMsg on the same stream in different goroutines.
113+
// to call SendMsg on the same stream in different goroutines. It is also
114+
// not safe to call CloseSend concurrently with SendMsg.
113115
SendMsg(m interface{}) error
114116
// RecvMsg blocks until it receives a message into m or the stream is
115117
// done. It returns io.EOF when the stream completes successfully. On

0 commit comments

Comments
 (0)