Created
April 10, 2015 08:37
-
-
Save oks/e5157b9953aabe4aa7ee to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (RACSignal *)endlessPollingWithSuccessDelay:(NSTimeInterval)successDelay failureDelay:(NSTimeInterval)failureDelay { | |
return [[[ | |
// After completion - Wait for successDelay | |
[self concat:[[RACSignal empty] delay:successDelay]] | |
// After failure - Wait for failure delay | |
catchTo:[[RACSignal empty] delay:failureDelay]] | |
// Resubscribe | |
repeat] | |
setNameWithFormat:@"Endless polling (%02.f/%02.f) of [ %@ ]", successDelay, failureDelay, self.name]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment