diff --git a/src/producer/base_producer.rs b/src/producer/base_producer.rs index cf7f30cde..643b6c6f4 100644 --- a/src/producer/base_producer.rs +++ b/src/producer/base_producer.rs @@ -494,7 +494,6 @@ where /// queued events, such as delivery notifications. The thread will be /// automatically stopped when the producer is dropped. #[must_use = "The threaded producer will stop immediately if unused"] -#[derive(Clone)] pub struct ThreadedProducer where C: ProducerContext + 'static, @@ -623,6 +622,16 @@ where } } +impl Clone for ThreadedProducer { + fn clone(&self) -> Self { + Self { + producer: self.producer.clone(), + should_stop: Arc::clone(&self.should_stop), + handle: self.handle.clone(), + } + } +} + impl Drop for ThreadedProducer where C: ProducerContext + 'static,