swift-server/async-http-client

Request prioritization

datwelk opened this issue · 2 comments

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?

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.

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