Skip to content

Idea: cheap trivial streams / futures #556

@lann

Description

@lann

(post-0.3.0)

Currently we use option<stream<...>> (e.g. here) to avoid stream bookkeeping for empty streams (iirc).

As an alternative, how about a stream.empty built-in that returns a "pre-dropped" readable stream? This would be semantically equivalent to stream.new + stream.drop-writable.

A little more complicated but potentially even more useful would be a future.resolved, acting like future.new + future.write. There are a lot of future<result<...>> return types that could benefit from being able to return future.resolved(err(...)).

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