17 NoCompression = cygrpc.CompressionAlgorithm.none
18 Deflate = cygrpc.CompressionAlgorithm.deflate
19 Gzip = cygrpc.CompressionAlgorithm.gzip
21 _METADATA_STRING_MAPPING = {
22 NoCompression:
'identity',
29 return _METADATA_STRING_MAPPING[compression]
33 return (cygrpc.GRPC_COMPRESSION_REQUEST_ALGORITHM_MD_KEY,
38 return ((cygrpc.GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM,
39 int(compression)),)
if compression
else ()
43 if not metadata
and not compression:
45 base_metadata = tuple(metadata)
if metadata
else ()
46 compression_metadata = (
48 return base_metadata + compression_metadata