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

make ThreadedProducer clonable like BaseProducer #26

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

petrosagg
Copy link

The threaded producer was not Clone due to handling the background thread join handle but that can easily be stored in an Arc that the last drop of the client unwraps and terminates the background thread.

Arc::into_inner guarantees that exactly one thread will manage to unwrap the handle.

this is a backport of fede1024#731

The threaded producer was not `Clone` due to handling the background
thread join handle but that can easily be stored in an `Arc` that the
last drop of the client unwraps and terminates the background thread.

`Arc::into_inner` guarantees that exactly one thread will manage to
unwrap the handle.
@petrosagg petrosagg requested a review from benesch October 3, 2024 15:47
@benesch benesch merged commit 3bec034 into master Oct 3, 2024
0 of 9 checks passed
@benesch benesch deleted the clonable-threaded-producer-backport branch October 3, 2024 15:49
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.

2 participants