Skip to content

Commit

Permalink
chore: change num connections config to usize
Browse files Browse the repository at this point in the history
  • Loading branch information
cprice404 committed Oct 9, 2024
1 parent 036c129 commit 9612858
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sdk/src/cache/cache_client_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl CacheClientBuilder<NeedsCredentialProvider> {
}

impl CacheClientBuilder<ReadyToBuild> {
pub fn with_num_connections(self, num_connections: u32) -> CacheClientBuilder<ReadyToBuild> {
pub fn with_num_connections(self, num_connections: usize) -> CacheClientBuilder<ReadyToBuild> {
let grpc_configuration = self.0.configuration.transport_strategy.grpc_configuration;
let transport_strategy = TransportStrategy {
grpc_configuration: GrpcConfiguration {
Expand Down
6 changes: 3 additions & 3 deletions sdk/src/config/grpc_configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub struct GrpcConfiguration {
/// with a DeadlineExceeded error.
pub(crate) deadline: Duration,
/// The number of grpc channels (TCP connections) to create
pub(crate) num_channels: u32,
pub(crate) num_channels: usize,
/// Indicates whether the client should send keep-alive pings.
///
/// NOTE: keep-alives are very important for long-lived server environments where there may be
Expand Down Expand Up @@ -40,7 +40,7 @@ pub struct NeedsDeadline(());
/// The state of the GrpcConfigurationBuilder when it is ready to build a GrpcConfiguration.
pub struct ReadyToBuild {
deadline: Duration,
num_channels: u32,
num_channels: usize,
keep_alive_while_idle: Option<bool>,
keep_alive_interval: Option<Duration>,
keep_alive_timeout: Option<Duration>,
Expand All @@ -61,7 +61,7 @@ impl GrpcConfigurationBuilder<NeedsDeadline> {
}

impl GrpcConfigurationBuilder<ReadyToBuild> {
pub(crate) fn num_channels(mut self, num_channels: u32) -> Self {
pub(crate) fn num_channels(mut self, num_channels: usize) -> Self {
self.0.num_channels = num_channels;
self
}
Expand Down

0 comments on commit 9612858

Please sign in to comment.