Re: [whatwg] Expose XMLHttpRequest [Fetch?] priority

On Wed, Oct 1, 2014 at 7:59 PM, Chad Austin <caustin@gmail.com> wrote:

> I don't see a way to set a priority value in there.  The specific wording
> is "Streams can be prioritized by marking them as dependent on the,
> completion of other streams".
>
> I see that a client can specify the weight of a stream and you can say
> that a stream depends on another stream.  Neither of those are what I
> want.  I simply want to specify priorities of a bunch of requests.  How
> would I do that in HTTP 2.0?
>

Weight is exactly what you want:
http://tools.ietf.org/html/draft-ietf-httpbis-http2-14#section-5.3.2

"A stream that is not dependent on any other stream is given a stream
   dependency of 0x0.  In other words, the non-existent stream 0 forms
   the root of the tree."

All dependent streams are allocated an integer weight between 1 to
   256 (inclusive)... Streams with the same parent SHOULD be allocated
resources
   proportionally based on their weight. "

In other words, if you don't care about dependencies, then don't assign the
parent. Doing so will make all streams children of the root of the tree
(0x0), and from there you can use weights to assign relative priority.

Hope that makes sense.

ig

Received on Thursday, 2 October 2014 03:20:41 UTC