forked from temporalio/sdk-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGrpcCompression.java
More file actions
31 lines (24 loc) · 1004 Bytes
/
Copy pathGrpcCompression.java
File metadata and controls
31 lines (24 loc) · 1004 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package io.temporal.serviceclient;
import io.grpc.Codec;
import io.grpc.DecompressorRegistry;
import javax.annotation.Nullable;
/** Selects transport-level gRPC compression for service calls. */
public enum GrpcCompression {
/** Do not compress requests or advertise support for compressed responses. */
NONE(null, DecompressorRegistry.emptyInstance().with(Codec.Identity.NONE, false)),
/** Gzip-compress outbound requests and accept gzip-compressed responses. */
GZIP("gzip", DecompressorRegistry.getDefaultInstance());
private final @Nullable String compressorName;
private final DecompressorRegistry decompressorRegistry;
GrpcCompression(@Nullable String compressorName, DecompressorRegistry decompressorRegistry) {
this.compressorName = compressorName;
this.decompressorRegistry = decompressorRegistry;
}
@Nullable
String getCompressorName() {
return compressorName;
}
DecompressorRegistry getDecompressorRegistry() {
return decompressorRegistry;
}
}