-
Notifications
You must be signed in to change notification settings - Fork 904
Description
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.