From d6b3525fce309648fa84e2e7b60f49873c3c366d Mon Sep 17 00:00:00 2001 From: Sardorbek Pulatov Date: Tue, 5 Nov 2019 16:42:32 +0100 Subject: [PATCH 1/3] (doc): add compression documentation part of #402 --- Documentation/compression.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Documentation/compression.md diff --git a/Documentation/compression.md b/Documentation/compression.md new file mode 100644 index 00000000..67cb1276 --- /dev/null +++ b/Documentation/compression.md @@ -0,0 +1,31 @@ +# Compression + +## Client side +The preferred method for configuring message compression on a client is to pass `options` when the client object is instantiated. + +The two options need to be passed: + +**grpc.default_compression_algorithm** (integer) + +The option keeps the value of a compression algorithm. + +Possible values for this option are: +- `0` - No compression +- `1` - Compress with DEFLATE algorithm +- `2` - Compress with GZIP algorithm +- `3` - Stream compression with GZIP algorithm + +**grpc.default_compression_level** (integer) + +The option keeps the value for the level of compression. + +Possible values for this option are: +- `0` - None +- `1` - Low level +- `2` - Medium level +- `3` - High level + +### Code example +```javascript +client = new ExampleClient("example.com", credentials.createInsecure(), {'grpc.default_compression_algorithm': 2, 'grpc.default_compression_level': 2}); +``` From 7c10ed272c05b2707e6b04cbb3d41bf59ecab9a2 Mon Sep 17 00:00:00 2001 From: Sardorbek Pulatov Date: Wed, 6 Nov 2019 12:15:09 +0100 Subject: [PATCH 2/3] CR fixes --- {Documentation => doc}/compression.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename {Documentation => doc}/compression.md (72%) diff --git a/Documentation/compression.md b/doc/compression.md similarity index 72% rename from Documentation/compression.md rename to doc/compression.md index 67cb1276..3510cafb 100644 --- a/Documentation/compression.md +++ b/doc/compression.md @@ -3,11 +3,11 @@ ## Client side The preferred method for configuring message compression on a client is to pass `options` when the client object is instantiated. -The two options need to be passed: +These two options control compression behavior: -**grpc.default_compression_algorithm** (integer) +**grpc.default_compression_algorithm** (int) -The option keeps the value of a compression algorithm. +Default compression algorithm for the channel. Possible values for this option are: - `0` - No compression @@ -15,9 +15,9 @@ Possible values for this option are: - `2` - Compress with GZIP algorithm - `3` - Stream compression with GZIP algorithm -**grpc.default_compression_level** (integer) +**grpc.default_compression_level** (int) -The option keeps the value for the level of compression. +Default compression level for the channel. Possible values for this option are: - `0` - None From 6b326d70b676056920b6397789e8d11d33d6bea3 Mon Sep 17 00:00:00 2001 From: Sardorbek Pulatov Date: Tue, 26 Nov 2019 13:30:32 +0100 Subject: [PATCH 3/3] CR comment fix --- doc/compression.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/compression.md b/doc/compression.md index 3510cafb..bfe325a0 100644 --- a/doc/compression.md +++ b/doc/compression.md @@ -7,7 +7,7 @@ These two options control compression behavior: **grpc.default_compression_algorithm** (int) -Default compression algorithm for the channel. +Default compression algorithm for the channel, applies to sending messages. Possible values for this option are: - `0` - No compression @@ -17,7 +17,7 @@ Possible values for this option are: **grpc.default_compression_level** (int) -Default compression level for the channel. +Default compression level for the channel, applies to receiving messages. Possible values for this option are: - `0` - None