考虑以下代码段:
- (RACSignal *)startRouting {
...
}
- (RACSignal *)updateRoutingWithSession:(NSString *)session {
...
}
- (RACSignal *)fetchFlights {
return [[self startRouting] flattenMap:^RACStream *(NSString *session) {
return [[[[self updateRoutingWithSession:session]
delay:2.0f]
repeat]
takeUntilBlock:^BOOL(RACTuple *operationAndResponse) {
AFHTTPRequestOperation *operation = [operationAndResponse first];
NSDictionary *response = [operationAndResponse second];
return [operation isCancelled] || 100 == [response[kPercentComplete] intValue];
}];
}];
}
这里发生的是startRouting返回RACSignal发送会话 ID 的 a 。
updateRoutingWithSession:返回 a RACSignal,它发送包含属性的NSDictionary外观。PercentComplete民意调查之间有两秒钟的延迟。
fetchFlights将运行直到updateRoutingWithSession:有PercentComplete100 个。
我的问题是最后一个sendNext:,即takeUntilBlock返回的地方true,没有到达RACSubscriber.
我错过了什么?