Skip to content

Consider marking streams as MustUse. #358

@frankmcsherry

Description

@frankmcsherry

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions