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

Remove the need to keep the stream around #613

Open
dvdsk opened this issue Sep 16, 2024 · 4 comments
Open

Remove the need to keep the stream around #613

dvdsk opened this issue Sep 16, 2024 · 4 comments
Labels
breaking Proposed change that would break the public API

Comments

@dvdsk
Copy link
Collaborator

dvdsk commented Sep 16, 2024

Its a common footgun in using rodio. It should be possible to store the stream in the sink.

Remaining questions, does the stream need to be accessible when a sink is used? If so how? Does sink get a method to get the stream?

Implementation wise it seems like storing the stream in an Arc will work.

@dvdsk dvdsk added the breaking Proposed change that would break the public API label Sep 16, 2024
@PetrGlad
Copy link

PetrGlad commented Sep 20, 2024

Can Sink's output be not a stream but another source? Should they give some shared reference to the output stream in that case?

I would keep sink as simple as possible unless there is a compelling reason to add anything to it. It is a lot harder to remove things from API than to add them.

@PetrGlad
Copy link

PetrGlad commented Sep 24, 2024

I am trying to prototype now to see how best to do this.

@dvdsk
Copy link
Collaborator Author

dvdsk commented Sep 24, 2024

Can Sink's output be not a stream but another source?

Thats actually quite a nice idea. I wonder if there is any reason thats not the case right now... It seems quite elegant!

@dvdsk
Copy link
Collaborator Author

dvdsk commented Sep 24, 2024

How would it help out for this issue though? The stream still needs to be kept somewhere.

And Sink is not really a footgun atm I rather not change it, Rodio has a ton of users depending on Sink in its current form.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Proposed change that would break the public API
Projects
None yet
Development

No branches or pull requests

2 participants