Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: produce config builder as mutable #4375

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fraidev
Copy link
Contributor

@fraidev fraidev commented Feb 1, 2025

TopicProducerConfigBuilder was created as owner, making it very difficult to handle and create wrappers for python client.

I changed this builder to the default behavior (mutable).

@fraidev fraidev force-pushed the producer_config_builder_clone branch from 3e93de3 to c4a9f0e Compare February 1, 2025 20:25
@fraidev fraidev marked this pull request as ready for review February 1, 2025 21:05
@fraidev fraidev changed the title chore: produce config cloneable chore: produce config builder as mutable Feb 1, 2025
@fraidev fraidev requested review from sehz and digikata February 1, 2025 21:06
} else {
Default::default()
let mut config_builder = TopicProducerConfigBuilder::default();
if self.interactive_mode() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we still need interactive mode?

pub fn set_specific_partitioner(self, partition_id: PartitionId) -> Self {
self.partitioner(Box::new(SpecificPartitioner::new(partition_id)))
pub fn set_specific_partitioner(&mut self, partition_id: PartitionId) -> &mut Self {
self.partitioner(Arc::new(SpecificPartitioner::new(partition_id)))
Copy link
Contributor

@digikata digikata Feb 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

| Perhaps we should make this Arc Box? It may be important in long running or high concurrency uses
same as previous line

@@ -88,7 +88,7 @@ pub struct TopicProducerConfig {
pub(crate) linger: Duration,
/// Partitioner assigns the partition to each record that needs to be send
#[builder(default = "default_partitioner()")]
pub(crate) partitioner: Box<dyn Partitioner + Send + Sync>,
pub(crate) partitioner: Arc<dyn Partitioner + Send + Sync>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we should make this Arc Box? It may be important in long running or high concurrency uses

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants