We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
与BatchRequest不同,我的理解是,链式调用其实就是同步多个XMRequest的发起和返回,在我们的项目中,我是使用dispatch_group 来做同步的,最终实现的ChainRequest调用方式和您这个BatchRequest 一样的,也是传入一组requestArray,利用requestArray 实现一个Queue的数据结构,所以能够保证request的发起顺序,并同步responseObject在responseArray的位置。而在您的项目中XMChainRequest的实现方式其实和我的方式差不多吧,不过您是使用dispatch_semaphore_t 配合游标_chainIndex来做同步。哈哈哈,突然有个想法,dispatch_group工作原理就是这么干的?
�回到正题,两种方式哪个新能更好?健壮性更高?出于本能吧,看到 [_responseArray addObject:[NSNull null]]; 以及[_responseArray replaceObjectAtIndex:index withObject:responseObject]; 心里就会停顿,总是会担心Crash。
The text was updated successfully, but these errors were encountered:
dispatch_group 就是用的信号量 差不太多啦
Sorry, something went wrong.
翻了下gcd源码,dispatch_group本身也是用的信号量来实现
No branches or pull requests
与BatchRequest不同,我的理解是,链式调用其实就是同步多个XMRequest的发起和返回,在我们的项目中,我是使用dispatch_group 来做同步的,最终实现的ChainRequest调用方式和您这个BatchRequest 一样的,也是传入一组requestArray,利用requestArray 实现一个Queue的数据结构,所以能够保证request的发起顺序,并同步responseObject在responseArray的位置。而在您的项目中XMChainRequest的实现方式其实和我的方式差不多吧,不过您是使用dispatch_semaphore_t 配合游标_chainIndex来做同步。哈哈哈,突然有个想法,dispatch_group工作原理就是这么干的?
�回到正题,两种方式哪个新能更好?健壮性更高?出于本能吧,看到 [_responseArray addObject:[NSNull null]]; 以及[_responseArray replaceObjectAtIndex:index withObject:responseObject]; 心里就会停顿,总是会担心Crash。
The text was updated successfully, but these errors were encountered: