Skip to content

Commit

Permalink
Merge pull request #572 from vasilvv/create-stream-flowcontrol
Browse files Browse the repository at this point in the history
Add a `waitUntilAvailable` option to stream creation
  • Loading branch information
jan-ivar authored Nov 21, 2023
2 parents 071e45d + 1022963 commit 6ab06d2
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1015,15 +1015,18 @@ these steps.
{{WebTransportSendStreamOptions/sendGroup}}.
1. Let |sendOrder| be {{WebTransport/createBidirectionalStream(options)/options}}'s
{{WebTransportSendStreamOptions/sendOrder}}.
1. Let |waitUntilAvailable| be {{WebTransport/createBidirectionalStream(options)/options}}'s
{{WebTransportSendStreamOptions/waitUntilAvailable}}.
1. Let |p| be a new promise.
1. Run the following steps [=in parallel=], but [=abort when=] |transport|'s
{{[[State]]}} becomes `"closed"` or `"failed"`, and instead
[=queue a network task=] with |transport| to [=reject=] |p| with an {{InvalidStateError}}:
1. Let |streamId| be a new stream ID that is valid and unique for
|transport|.{{[[Session]]}}, as defined in [[!QUIC]]
[Section 19.11](https://www.rfc-editor.org/rfc/rfc9000#section-19.11). If one is not
immediately available due to exhaustion, [=reject=] |p| with a {{QuotaExceededError}}
and abort these steps.
immediately available due to exhaustion, wait for it to become
available if |waitUntilAvailable| is true, [=reject=] |p| with a
{{QuotaExceededError}} and abort these steps otherwise.
1. Let |internalStream| be the result of [=creating a bidirectional stream=] with
|transport|.{{[[Session]]}} and |streamId|.
1. [=Queue a network task=] with |transport| to run the following steps:
Expand All @@ -1049,15 +1052,18 @@ these steps.
{{WebTransportSendStreamOptions/sendGroup}}.
1. Let |sendOrder| be {{WebTransport/createUnidirectionalStream(options)/options}}'s
{{WebTransportSendStreamOptions/sendOrder}}.
1. Let |waitUntilAvailable| be {{WebTransport/createUnidirectionalStream(options)/options}}'s
{{WebTransportSendStreamOptions/waitUntilAvailable}}.
1. Let |p| be a new promise.
1. Run the following steps [=in parallel=], but [=abort when=] |transport|'s
{{[[State]]}} becomes `"closed"` or `"failed"`, and instead
[=queue a network task=] with |transport| to [=reject=] |p| with an {{InvalidStateError}}:
1. Let |streamId| be a new stream ID that is valid and unique for
|transport|.{{[[Session]]}}, as defined in [[!QUIC]]
[Section 19.11](https://www.rfc-editor.org/rfc/rfc9000#section-19.11). If one is not
immediately available due to exhaustion, [=reject=] |p| with a {{QuotaExceededError}}
and abort these steps.
immediately available due to exhaustion, wait for it to become
available if |waitUntilAvailable| is true, [=reject=] |p| with a
{{QuotaExceededError}} and abort these steps otherwise.
1. Let |internalStream| be the result of [=creating an outgoing unidirectional stream=] with
|transport|.{{[[Session]]}} and |streamId|.
1. [=Queue a network task=] with |transport| to run the following steps:
Expand Down Expand Up @@ -1320,6 +1326,7 @@ dictionary of parameters that affect how {{WebTransportSendStream}}s created by
dictionary WebTransportSendStreamOptions {
WebTransportSendGroup? sendGroup = null;
long long sendOrder = 0;
boolean waitUntilAvailable = false;
};
</pre>

Expand All @@ -1346,6 +1353,15 @@ The dictionary SHALL have the following attributes:
Note: This is sender-side data prioritization which does not guarantee
reception order.

: <dfn for="WebTransportSendStreamOptions" dict-member>waitUntilAvailable</dfn>
:: If true, the promise returned by the
{{WebTransport/createUnidirectionalStream}} or
{{WebTransport/createBidirectionalStream}} call will not be [=settled=]
until either the [=underlying connection=] has sufficient flow control
credit to create the stream, or the connection reaches a state in which no
further outgoing streams are possible. If false, the promise will be
[=rejected=] if no flow control window is available at the time of the call.

## `WebTransportConnectionStats` Dictionary ## {#web-transport-connection-stats}

The <dfn dictionary>WebTransportConnectionStats</dfn> dictionary includes information
Expand Down

0 comments on commit 6ab06d2

Please sign in to comment.