Skip to content
This repository was archived by the owner on Feb 16, 2026. It is now read-only.

Commit bfca17f

Browse files
authored
feat: Enable compression (#147)
1 parent 95956ab commit bfca17f

File tree

3 files changed

+52
-6
lines changed

3 files changed

+52
-6
lines changed

Cargo.lock

Lines changed: 46 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ thiserror = "1.0.67"
3939
tokio = { version = "1.41.1", features = ["time"] }
4040
tokio-muxt = "0.5.0"
4141
tokio-stream = "0.1.16"
42-
tonic = { version = "0.12.3", features = ["tls", "tls-webpki-roots"] }
42+
tonic = { version = "0.12.3", features = ["tls", "tls-webpki-roots", "zstd"] }
4343
tonic-side-effect = "0.2.0"
4444
tower-service = "0.3.3"
4545
tracing = "0.1.40"

src/service/stream.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use prost_types::method_options::IdempotencyLevel;
2-
use tonic::{transport::Channel, IntoRequest};
2+
use tonic::{codec::CompressionEncoding, transport::Channel, IntoRequest};
33
use tonic_side_effect::{FrameSignal, RequestFrameMonitor};
44

55
use super::{
@@ -69,7 +69,7 @@ impl ReadServiceRequest {
6969
req: types::ReadRequest,
7070
) -> Self {
7171
Self {
72-
client,
72+
client: client.accept_compressed(CompressionEncoding::Zstd),
7373
stream: stream.into(),
7474
req,
7575
}
@@ -116,7 +116,7 @@ impl ReadSessionServiceRequest {
116116
req: types::ReadSessionRequest,
117117
) -> Self {
118118
Self {
119-
client,
119+
client: client.accept_compressed(CompressionEncoding::Zstd),
120120
stream: stream.into(),
121121
req,
122122
}
@@ -188,7 +188,7 @@ impl AppendServiceRequest {
188188
req: types::AppendInput,
189189
) -> Self {
190190
Self {
191-
client,
191+
client: client.send_compressed(CompressionEncoding::Zstd),
192192
append_retry_policy,
193193
frame_signal,
194194
stream: stream.into(),
@@ -261,7 +261,7 @@ where
261261
req: S,
262262
) -> Self {
263263
Self {
264-
client,
264+
client: client.send_compressed(CompressionEncoding::Zstd),
265265
stream: stream.into(),
266266
req: Some(req),
267267
}

0 commit comments

Comments
 (0)