Skip to content

Commit

Permalink
minor udpate / making create_client public at crate level
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielePalaia committed Nov 24, 2024
1 parent 90364ff commit 897e9be
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
4 changes: 1 addition & 3 deletions src/consumer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,11 @@ impl ConsumerBuilder {

let collector = self.environment.options.client_options.collector.clone();

let client_uwrapped = self
let client = self
.environment
.create_consumer_client(stream, self.client_provided_name.clone())
.await?;

let client = client_uwrapped.clone();

let subscription_id = 1;
let (tx, rx) = channel(10000);
let consumer = Arc::new(ConsumerInternal {
Expand Down
4 changes: 2 additions & 2 deletions src/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl Environment {
Ok(Environment { options })
}

pub async fn create_producer_client(
pub(crate) async fn create_producer_client(
self,
stream: &str,
client_provided_name: String,
Expand Down Expand Up @@ -91,7 +91,7 @@ impl Environment {
Ok(client)
}

pub async fn create_consumer_client(
pub(crate) async fn create_consumer_client(
self,
stream: &str,
client_provided_name: String,
Expand Down
4 changes: 1 addition & 3 deletions src/producer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,11 @@ impl<T> ProducerBuilder<T> {

let metrics_collector = self.environment.options.client_options.collector.clone();

let client_unwrapped = self
let client = self
.environment
.create_producer_client(stream, self.client_provided_name.clone())
.await?;

let client = client_unwrapped;

let mut publish_version = 1;

if self.filter_value_extractor.is_some() {
Expand Down

0 comments on commit 897e9be

Please sign in to comment.