Skip to content

Shared stream#1328

Open
tmccombs wants to merge 10 commits intorust-lang:masterfrom
tmccombs:shared-stream-vec
Open

Shared stream#1328
tmccombs wants to merge 10 commits intorust-lang:masterfrom
tmccombs:shared-stream-vec

Conversation

@tmccombs
Copy link
Copy Markdown
Contributor

This is similar to #1217 but uses an underlying boxed slice to buffer items, and as a side-effect has a finite buffer size.

This is a work in progress. I'd still like to add some more rigorous unit tests, but I'd like feedback on my general approach, and have other eyes check my logic.

@ebkalderon
Copy link
Copy Markdown
Contributor

Has there been any additional progress on this recently? I happen to be looking for this exact feature.

@tmccombs
Copy link
Copy Markdown
Contributor Author

I haven't done anything more with this. I would like some feedback on my approach before I put more effort into polishing it.

@tmccombs
Copy link
Copy Markdown
Contributor Author

@cramertj, @MajorBreakfast any thoughts on this?

@ebkalderon
Copy link
Copy Markdown
Contributor

Is this PR still being worked on? I ran into several more cases over the past two years where this API could be useful. I'm willing to take over this PR and help drive it to completion if the original author is away. @cramertj, any thoughts on this?

@tmccombs
Copy link
Copy Markdown
Contributor Author

I'm still around. It's been a while since I looked at this, but I was waiting on feedback from the maintainers.

@tmccombs tmccombs force-pushed the shared-stream-vec branch from f19ca59 to 4bb28a3 Compare June 17, 2020 07:02
@tmccombs
Copy link
Copy Markdown
Contributor Author

Looks like the shared future::Shared was refactored a little bit. So I rebased my branch on master. One piece that is still missing from this is some unit tests for stream::Shared. If you wanted to help write some @ebkalderon that might be helpful.

@ebkalderon
Copy link
Copy Markdown
Contributor

Sure thing, @tmccombs! I'll write a few, perhaps based on the tests for future::Shared, and I'll post them here.

@ebkalderon
Copy link
Copy Markdown
Contributor

@tmccombs I didn't get around to writing tests for this, unfortunately, but it seems that the current commit is failing in CI due to a clippy lint for unnested-or-patterns (source). I can write some tests once this is fixed and open a PR against your branch, perhaps, so you can merge them in and have them ready for review here.

@tmccombs
Copy link
Copy Markdown
Contributor Author

@ebkalderon those clippy lints are for code I didn't touch, and making the suggested change results in an "or-patterns syntax is experimental" error on stable rust.

@ebkalderon
Copy link
Copy Markdown
Contributor

Got it! Thanks for clarifying and updating the branch. I'll get started writing some tests and open a PR against your fork.

@taiki-e taiki-e added A-stream Area: futures::stream and removed futures-util labels Dec 17, 2020
@tmccombs tmccombs force-pushed the shared-stream-vec branch from ad4cea8 to eb1b793 Compare April 6, 2022 06:45
@tmccombs tmccombs requested a review from taiki-e as a code owner April 6, 2022 06:45
@tmccombs tmccombs force-pushed the shared-stream-vec branch from eb1b793 to 9875351 Compare April 6, 2022 06:48
@tmccombs
Copy link
Copy Markdown
Contributor Author

tmccombs commented Apr 6, 2022

Conflicts have been resolved and this is up-to-date with current master.

@tmccombs
Copy link
Copy Markdown
Contributor Author

tmccombs commented Apr 7, 2022

The failed miri test looks like it is probably unrelated, but I'm not completely sure.

@XLordalX
Copy link
Copy Markdown

Any updates?

@tmccombs tmccombs force-pushed the shared-stream-vec branch 3 times, most recently from 88913ca to 873749c Compare March 1, 2023 09:03
@tmccombs
Copy link
Copy Markdown
Contributor Author

tmccombs commented Mar 5, 2023

@XLordalX your comment got me to revisit this, and I wrote some tests, which led to finding some bugs which I have now fixed, and reworked it a fair amount.

It is still failing CI. Something about a race condition found with thread sanitization. I don't really understand it yet.

I would kind of like some feedback from the futures maintainers to know if this a direction worth pursuing. And, to be honest, I kind of hope someone comes along and says there is a simpler way to do it.

@tmccombs tmccombs changed the title Shared stream WIP Shared stream Mar 12, 2023
@tmccombs tmccombs force-pushed the shared-stream-vec branch from 632f931 to 033ebe2 Compare March 13, 2023 06:48
@XLordalX
Copy link
Copy Markdown

@taiki-e You able to look at this?

@tmccombs tmccombs force-pushed the shared-stream-vec branch from 8431d10 to 3af17a1 Compare March 20, 2023 07:02
@tmccombs
Copy link
Copy Markdown
Contributor Author

hmm, looks like builds are currently broken on master.

@tmccombs tmccombs force-pushed the shared-stream-vec branch from 3af17a1 to 60140a1 Compare April 26, 2023 06:54
@rustbot

This comment has been minimized.

So that we can also use it for stream/shared
@tmccombs tmccombs force-pushed the shared-stream-vec branch from 60140a1 to 8c2adf0 Compare April 24, 2026 08:00
@rustbot rustbot added the A-future Area: futures::future label Apr 24, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 24, 2026

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@tmccombs tmccombs force-pushed the shared-stream-vec branch from 8c2adf0 to 2de9c42 Compare April 24, 2026 08:07
@tmccombs tmccombs force-pushed the shared-stream-vec branch from 2de9c42 to fe7be26 Compare April 26, 2026 23:46
@tmccombs tmccombs force-pushed the shared-stream-vec branch from 3481a0d to dc16318 Compare April 27, 2026 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-future Area: futures::future A-stream Area: futures::stream

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants