-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
Possible enhancement: Allow setting request priorities #1361
Comments
This is a tricky feature to do generally. Is policy fixed or pluggable? Does the default policy starve low priority requests? When is priority enforced? Do we short circuit low priority calls that would benefit from the cache? Is the priority shared with the HTTP/2 server? I'm reluctant to solve this partially, and solving it generally is a lot of work. I'd prefer to punt on this for now. |
AH, got it. I didn't think of that. Anyway, this is something I need and I feel it would be a good addition to On Thu, Feb 5, 2015 at 2:31 AM, Jesse Wilson notifications@github.com
Vinay S Shenoy |
Cool. I think we'll probably hold on priorities until we also make the backend async for HTTP/2. When things are async we suddenly get better control over which order tasks are completed. |
@swankjesse Is there a timeline for when the backend will be async? |
No timeline. |
@swankjesse is this feature implemented ??? |
Not implemented. |
I don't quite understand the worries cited above. Couldn't the priority simply be forwarded to the HTTP/2 server and be interpreted by the server? How the server interprets priorities is given by the HTTP/2 spec (they can be ignored), and whether requests are starved etc. is out of scope for the library. The tcp socket buffer size is the only thing the client needs to have control of. |
OkHttp has a queue of pending requests not yet transmitted to the server. A good priority mechanism should probably influence the queue. |
For our use case, we only wanted new requests to be prioritized over old requests, specifically with regard to the This seems to be a more sensible default for many applications, if a real prioritization feature isn't on the roadmap for the foreseeable future. |
Duplicate of #404 |
I've been using Volley with an OkHttp stack for a while now, but I've been wanting to switch to a pure OkHttp stack for a while now(streaming response bodies, interceptors, multipart requests, ease of integration are a few of the reasons).
One of the reasons I have held of on this change is because Volley has one feature that OkHttp doesn't have yet: support for prioritizing requests. Would such a feature be acceptable as a Pull Request if I implement it?
The text was updated successfully, but these errors were encountered: