Skip to content

Commit

Permalink
Add sendGroup.weight and datagramsWritable.weight
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-ivar committed Oct 22, 2024
1 parent 98e995c commit 6d45ded
Showing 1 changed file with 34 additions and 4 deletions.
38 changes: 34 additions & 4 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ features to [=send a datagram | send datagrams=].
<pre class="idl">
[Exposed=(Window,Worker), SecureContext, Transferable]
interface WebTransportDatagramsWritable : WritableStream {
attribute unsigned long long weight;
};
</pre>

Expand All @@ -354,6 +355,10 @@ A {{WebTransportDatagramsWritable}} object has the following internal slots.
<td class="non-normative">A queue of tuples of an outgoing datagram, a timestamp and a promise
which is resolved when the datagram is sent or discarded.
</tr>
<tr>
<td><dfn>`[[Weight]]`</dfn>
<td class="non-normative">A weight value for send dequeue purposes, defaulting to 1.
</tr>
</tbody>
</table>

Expand All @@ -380,11 +385,20 @@ The user agent MAY update {{[[OutgoingMaxDatagramSize]]}} for any {{WebTransport
: {{[[OutgoingDatagramsExpirationDuration]]}}
:: null
: {{[[OutgoingMaxDatagramSize]]}}
:: an [=implementation-defined=] integer.
:: an [=implementation-defined=] integer
: {{[[Weight]]}}
:: 1
1. Return |stream|.

## Attributes ## {#datagram-writable-attributes}

: <dfn for="WebTransportDatagramsWritable" attribute>weight</dfn>
:: The getter steps are:
1. Return [=this=]'s {{WebTransportDatagramsWritable/[[Weight]]}}.
:: The setter steps, given |value|, are:
1. If |value| is less than 1 or NaN, [=throw=] a {{RangeError}}.
1. Set [=this=].{{WebTransportDatagramsWritable/[[Weight]]}} to |value|.

## Procedures ## {#datagram-writable-procedures}

<div algorithm>
Expand Down Expand Up @@ -1980,13 +1994,23 @@ also establishes a separate numberspace for evaluating
[Exposed=(Window,Worker), SecureContext]
interface WebTransportSendGroup {
Promise&lt;WebTransportSendStreamStats&gt; getStats();
attribute unsigned long long weight;
};
</pre>

A {{WebTransportSendGroup}} is always created by the
[=WebTransportSendGroup/create=] procedure.

## Methods ## {#sendGroup-methods}
## Attributes ## {#send-group-attributes}

: <dfn for="WebTransportSendGroup" attribute>weight</dfn>
:: The getter steps are:
1. Return [=this=]'s {{WebTransportSendGroup/[[Weight]]}}.
:: The setter steps, given |value|, are:
1. If |value| is less than 1 or NaN, [=throw=] a {{RangeError}}.
1. Set [=this=].{{WebTransportSendGroup/[[Weight]]}} to |value|.

## Methods ## {#send-group-methods}

: <dfn for="WebTransportSendGroup" method>getStats()</dfn>
:: Aggregates stats from all {{WebTransportSendStream}}s
Expand All @@ -2005,7 +2029,7 @@ A {{WebTransportSendGroup}} is always created by the
1. [=Resolve=] |p| with |stats|.
1. Return |p|.

## Internal Slots ## {#sendGroup-internal-slots}
## Internal Slots ## {#send-group-internal-slots}

A {{WebTransportSendGroup}} has the following internal slots.

Expand All @@ -2021,10 +2045,14 @@ A {{WebTransportSendGroup}} has the following internal slots.
<td><dfn>`[[Transport]]`</dfn>
<td class="non-normative">The {{WebTransport}} object owning this {{WebTransportSendGroup}}.
</tr>
<tr>
<td><dfn>`[[Weight]]`</dfn>
<td class="non-normative">A weight value for send dequeue purposes, defaulting to 1.
</tr>
<tbody>
</table>

## Procedures ## {#sendGroup-procedures}
## Procedures ## {#send-group-procedures}

<div algorithm="create a SendGroup">

Expand All @@ -2034,6 +2062,8 @@ To <dfn export for="WebTransportSendGroup" lt="create|creating">create</dfn> a
1. Let |sendGroup| be a [=new=] {{WebTransportSendGroup}}, with:
: {{WebTransportSendGroup/[[Transport]]}}
:: |transport|
: {{WebTransportSendGroup/[[Weight]]}}
:: 1
1. Return |sendGroup|.

</div>
Expand Down

0 comments on commit 6d45ded

Please sign in to comment.