ASIHTTPRequest: request prioritization

Using ASIHTTPRequest , is it possible to prioritize requests or indicate their order?

I am using ASIHTTPRequest along with ASINetworkQueue . For example, I send a request 1, 2, 3, 4, 5, .... By default, ASIHTTPRequest supports 4 concurrent connections, so the result of request 5 starts when any of the previous requests completes. Now, in my case, I may need to publish a request (say A) before request 5. Request A can be called as a result of request 1 (success).

+4
source share
1 answer

ASIHTTPRequests are a subclass of NSOperation and run inside NSOperationQueue , so you can set the priority as follows:

 request.queuePriority = NSOperationQueuePriorityHigh; 
+4
source

Source: https://habr.com/ru/post/1388600/


All Articles