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

Function RPCCompressor

server.go:422–426  ·  view source on GitHub ↗

RPCCompressor returns a ServerOption that sets a compressor for outbound messages. For backward compatibility, all outbound messages will be sent using this compressor, regardless of incoming message compression. By default, server messages will be sent using the same compressor with which request

(cp Compressor)

Source from the content-addressed store, hash-verified

420// Deprecated: use encoding.RegisterCompressor instead. Will be supported
421// throughout 1.x.
422func RPCCompressor(cp Compressor) ServerOption {
423 return newFuncServerOption(func(o *serverOptions) {
424 o.cp = cp
425 })
426}
427
428// RPCDecompressor returns a ServerOption that sets a decompressor for inbound
429// messages. It has higher priority than decompressors registered via

Callers 4

makeClientsFunction · 0.92
listenAndServeMethod · 0.92
startServerMethod · 0.92

Calls 1

newFuncServerOptionFunction · 0.85

Tested by 3

listenAndServeMethod · 0.74
startServerMethod · 0.74