-
Notifications
You must be signed in to change notification settings - Fork 9.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement RFC 9113 stream priorities for HTTP/2 #404
Comments
Is there any progress in this issue? |
No On Mon, Jun 6, 2016 at 10:29 PM shanghuibo [email protected] wrote:
|
我是来看jake大神的 |
Dispatcher ProposalI propose a prioritization scheme for use in processing Dispatcher’s backlog of async calls. Each call has a priority between 0.0 (lowest priority) and 1.0 (highest priority). The default priority is 0.1. We assign each queued call a priority score using the following function:
Suppose we enqueue 3 calls: A enqueued at time=0, priority=1.0 At time 200 we compute the priorities as A=1200, B=550, C=0. Higher priority requests “age faster” than lower-priority requests. Any request with a non-zero priority eventually has been queued long enough to be preferred over higher-priority requests. Another example: D enqueued at time=0, priority=0.1 Requests of priority 0.0 are allowed to starve and are only processed if requests of higher priority are not enqueued. |
Current dispatcher has readyAsyncCalls and runningAsyncCalls. How to implement this scheme? |
Is there any update on this? |
As a workaround, would you accept a pr that allows the caller to optionally provide their own I'm thinking that |
You could create two instances of OkHttpClient, one for high-priority calls and one for low-priority calls. We can’t make |
Could you expand on how that would work exactly? How would one instance of the OkHttpClient be able to "communicate" with the other one and say "my requests are higher priority than yours"? Maybe some brief example code if possible, thanks! |
Is this issue still being worked on? |
@fzandroid nopers! We work in the open here so there's nothing happening in OkHttp that isn't also happening in GitHub. |
HTTP/2 dropped its priority scheme. |
What makes you say HTTP/2 priority was dropped? On the contrary, RFC 9113 says that it retains RFC 7540's priority fields in order to maintain interoperability:
And it goes on to say that priority is (still) important and encourage the use of RFC 9218:
The footnote for HTTP-PRIORITY links to RFC 9218, which seems very forward-looking:
If anything, how clients communicate priority will change as HTTP/3 is adopted. But RFC 7540 support hasn't been dropped and the IETF has defined a scheme that will allow them to support priority as a feature beyond HTTP/2. |
[Edit: I think your links have more context.]
Do we have real numbers for usage? Regardless, I don't think there is appetite and incentives to tackle this in OkHttp. |
Yes |
I think we want to track RFC 9113’s prioritization scheme. |
…favourite, get torrent list etc.) Currently okhttp does not support request priority(See square/okhttp#404), and our GalleryDetailScene will launch at most 200 image requests once, which stuffed okhttp async request queue. We need another http client to ensure these plain-text request executed in time
At the moment we don't honor stream priority, and we don't allow app developers to prioritize their streams.
We should.
The text was updated successfully, but these errors were encountered: