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

Consider marking streams as MustUse. #358

Open
frankmcsherry opened this issue Feb 8, 2021 · 1 comment
Open

Consider marking streams as MustUse. #358

frankmcsherry opened this issue Feb 8, 2021 · 1 comment

Comments

@frankmcsherry
Copy link
Member

It is a bit of a smell to have unused timely dataflow streams. They are not harmful (data terminate at operators that are not used, rather than eagerly cloned for an unused stream), but it is odd to create one and not use it. We could mark them as MustUse which will at least warn if streams are created and then dropped without being used.

The main downside seems to be that it would introduce warning noise to all timely projects, as e.g. the pattern

mystream
    .do_stuff()
    .probe_with(&mut probe);

ends with a stream (probe_with outputs its input stream, after the probe has been updated). Perhaps we'd want a .cap() method to make it easy to remove the error. Putting a let _ = at the beginning of each of these pipelines might be annoying. Anyhow, food for thought.

cc: @benesch

@benesch
Copy link
Contributor

benesch commented Feb 8, 2021

I think we could alternatively mark all the functions besides probe as must_use, but not the Stream type itself.

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

No branches or pull requests

2 participants