Firefox Tomorrow

web api instance property

WebTransportSendStream: sendOrder property

View on MDN ↗

Secure context Available in workers

The sendOrder property of the WebTransportSendStream interface indicates the send priority of this stream relative to other streams for which the value has been set.

Queued bytes are sent first for streams that have a higher value. If not set, the send order depends on the implementation.

Value

A number indicating the relative priority of this stream when sending bytes.

Examples

The example below shows how you can set the initial sendOrder when calling createUnidirectionalStream() to create the send stream, read the value from the stream, and then change the order. After changing the order the priority of this stream would increase, becoming higher than any stream with a priority of less than “596996858”.

async function writeData() {
  const stream = await transport.createUnidirectionalStream({
    sendOrder: "400", // Set initial stream order
  });

  console.log(`Stream order: ${stream.sendOrder}`); // Stream order: 400

  // write data ...

  // Change the stream order
  stream.sendOrder = 596996858;
  console.log(`Stream order: ${stream.sendOrder}`); // Stream order: 596996858

  // write more data ...
}

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also