Skip to content

stream_writable for new streams #2241

@kixelated

Description

@kixelated

I created a wrapper around each stream that calls stream_writable before stream_send. The idea is that this would queue up stream_writable_next if false. Unfortunately this doesn't work for new streams, as stream_writable returns InvalidStreamState if the stream has not been created yet.

This feels counter-intuitive because the stream_send will succeed; the stream is in fact writable. I think it would be useful behavior because it removes the guess-work for peer_streams_left. The new stream would only be marked writable (createable) when MAX_STREAMS flow control allows it.

My workaround is to call stream_send(id, &[], false) first to create the empty stream first. In hind-sight, I should really just try calling stream_send first and stream_writable only when it performs an incomplete write, but it would still be useful for MAX_STREAMS.

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