MCPcopy
hub / github.com/grpc/grpc-go / SetSendCompress

Method SetSendCompress

internal/transport/server_stream.go:112–119  ·  view source on GitHub ↗

SetSendCompress sets the compression algorithm to the stream.

(name string)

Source from the content-addressed store, hash-verified

110
111// SetSendCompress sets the compression algorithm to the stream.
112func (s *ServerStream) SetSendCompress(name string) error {
113 if s.isHeaderSent() || s.getState() == streamDone {
114 return errors.New("transport: set send compressor called after headers sent or stream done")
115 }
116
117 s.sendCompress = name
118 return nil
119}
120
121// SetContext sets the context of the stream. This will be deleted once the
122// stats handler callouts all move to gRPC layer.

Callers 4

processUnaryRPCMethod · 0.80
processStreamingRPCMethod · 0.80
SetSendCompressorFunction · 0.80

Implementers 1

serverStreamstream.go

Calls 2

isHeaderSentMethod · 0.95
getStateMethod · 0.45

Tested by 1