AFNetworking/AFNetworking — pull request #1620 by stuckj (2013-11-21 19:33:00+00:00)
Title: Exposing adding operations to the operation queue.

This is just a super simple change to expose adding an operation to the operation queue as an overridable method in AFHTTPRequestOperationManager. This lets you setup dependencies between the operation to be added and any any existing operations in the queue.

E.g., if you have endpoints for user CRUD operations for a system at /user*, you can make any operation that hits /user* depend on any existing operation in the operation queue that hits /user* so you don't have race conditions on a POST and PUT operation (for user creation and updating).

Would actually be awesome if this could be done with AFHTTPSessionManager, but I didn't see an easy way to do that since it doesn't use an NSOperationQueue (short of building out infrastructure in front of the AFHTTPSessionManager object to do the dependency stuff).