Skip to content
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

Request prioritization #623

Closed
datwelk opened this issue Aug 31, 2022 · 2 comments
Closed

Request prioritization #623

datwelk opened this issue Aug 31, 2022 · 2 comments

Comments

@datwelk
Copy link

datwelk commented Aug 31, 2022

URLSessionTask from the Foundation framework has a priority property to distinguish between different task priorities.

It seems this is not supported out-of-the-box with an HTTPClient from this library. What would be the best way to go about implementing this as an API user? Is the advised way of doing this with a priority queue on the application level?

@Lukasa
Copy link
Collaborator

Lukasa commented Sep 2, 2022

Yeah, this would be the piece of advice I'd give. We could in principle add functionality like this, but it plays poorly with showing you the depth of the queue of work, making it hard for us to apply backpressure to your code. Having a priority queue in your own code enables you to add that behaviour yourself.

@datwelk
Copy link
Author

datwelk commented Sep 2, 2022

Gotcha. I will implement something using apple/swift-collections#51. Thanks

@datwelk datwelk closed this as completed Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants