RequestQueue
RequestQueue copied to clipboard
allowDuplicateRequests alternative behavior?
Some HTTP servers support "request combining" so that if another request arrives while an earlier request for the same endpoint is still "in flight" then the most recent request is added to a queue of that very first request. Once that first request succeeds (or fails) all those queue'd later requests succeed or fail.
So a different behavior for allowDuplicateRequests, rather than failing if set to NO, would be to queue up this RequestOperation so that when the first one in the queue succeeds or fails this RequestOperation gets called.
The behavior for the actual resources created in the request needs some thought. Its probably cleaner and simpler to have them copied rather than shared but there could be some advantages for sharing.