Skip to content

Commit

Permalink
Add docs for StreamingHandlerConn concurrency constraints
Browse files Browse the repository at this point in the history
Adds docs for the StreamingHandlerConn interface stating the constraints for
concurrent use. The grouped methods are similar to the clients
StreamingClientConn interface.

Signed-off-by: Edward McFarlane <[email protected]>
  • Loading branch information
emcfarlane committed Nov 2, 2024
1 parent 74a6754 commit fde4c83
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,17 @@ func (s StreamType) String() string {
//
// StreamingHandlerConn implementations do not need to be safe for concurrent use.
type StreamingHandlerConn interface {
// Spec and Peer must be safe to call concurrently with all other methods.
Spec() Spec
Peer() Peer

// Receive, and RequestHeader may race with each other, but must be
// safe to call concurrently with all other methods.
Receive(any) error
RequestHeader() http.Header

// Send, ResponseHeader, and ResponseTrailer may race with each other,
// but must be safe to call concurrently with all other methods.
Send(any) error
ResponseHeader() http.Header
ResponseTrailer() http.Header
Expand Down

0 comments on commit fde4c83

Please sign in to comment.