-
Notifications
You must be signed in to change notification settings - Fork 486
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
base: master
Are you sure you want to change the base?
Conversation
3e93de3
to
c4a9f0e
Compare
} else { | ||
Default::default() | ||
let mut config_builder = TopicProducerConfigBuilder::default(); | ||
if self.interactive_mode() { |
There was a problem hiding this comment.
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))) |
There was a problem hiding this comment.
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>, |
There was a problem hiding this comment.
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
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).