mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-23 12:27:52 +08:00
Add new queue method for checking the queue for a request with a given URL
This commit is contained in:
@@ -174,6 +174,13 @@
|
||||
*/
|
||||
- (BOOL)containsRequest:(RKRequest *)request;
|
||||
|
||||
/**
|
||||
Determine if a request with the given URL is currently in this queue.
|
||||
|
||||
@param URL A URL to search the requests within the queue for.
|
||||
@return YES if a request with the given URL is in this queue.
|
||||
*/
|
||||
- (BOOL)containsRequestWithURL:(NSURL *)URL;
|
||||
|
||||
///-----------------------------------------------------------------------------
|
||||
/// @name Processing Queued Requests
|
||||
|
||||
@@ -409,6 +409,19 @@ static const NSTimeInterval kFlushDelay = 0.3;
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)containsRequestWithURL:(NSURL *)URL
|
||||
{
|
||||
@synchronized(self) {
|
||||
for (RKRequest *request in _requests) {
|
||||
if ([request.URL isEqual:URL]) {
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void)cancelRequest:(RKRequest *)request loadNext:(BOOL)loadNext
|
||||
{
|
||||
if ([request isUnsent]) {
|
||||
|
||||
Reference in New Issue
Block a user