AFNetworking 2.x中,关于网络请求的并发是通过NSOperation
&NSOperationQueue
实现的。
- 网络调用相关封装在NSOperation的子类
AFURLConnectionOperation
中。- 类
AFHTTPRequestOperationManager
通过NSOperationQueue完成对AFURLConnectionOperation
的调度,当AFURLConnectionOperation
一旦被加入到NSOperationQueue
中,就开始了对网络并发执行.AFURLConnectionOperation
可以通过调用start
方法单独执行,此时和NSOperationQueue
无关的。