RKRequestQueue Class Reference
| Inherits from | NSObject |
| Declared in | RKRequestQueue.h RKRequestQueue.m |
Overview
A lightweight queue implementation responsible for dispatching and managing RKRequest objects.
Tasks
Creating a Request Queue
-
+ requestQueueCreates and returns a new request queue.
-
+ newRequestQueueWithName:Returns a new retained request queue with the given name. If there is already an existing queue with the given name, nil will be returned.
Retrieving an Existing Queue
-
+ requestQueueWithName:Returns queue with the specified name. If no queue is found with the name provided, a new queue will be initialized and returned.
Naming Queues
-
nameA symbolic name for the queue.
property -
+ requestQueueExistsWithName:Determine if a queue exists with a given name.
Monitoring State Changes
-
delegateThe delegate to inform when the request queue state machine changes.
property
Managing the Queue
-
concurrentRequestsLimitThe number of concurrent requests supported by this queue.
property -
requestTimeoutRequest timeout value used by the queue.
property -
countReturns the total number of requests in the queue.
property -
– addRequest:Add an asynchronous request to the queue and send it as as soon as possible.
-
– cancelRequest:Cancel a request that is in progress.
-
– cancelRequestsWithDelegate:Cancel all requests with a given delegate.
-
– abortRequestsWithDelegate:Aborts all requests with a given delegate by nullifying the delegate reference and canceling the request.
-
– cancelAllRequestsCancel all active or pending requests.
-
– containsRequest:Determine if a given request is currently in this queue.
Processing Queued Requests
-
– startStart checking for and processing requests.
-
suspendedSets the flag that determines if new load requests are allowed to reach the network.
property -
loadingCountReturns the total number of requests that are currently loading.
property -
showsNetworkActivityIndicatorWhenBusySets the flag for showing the network activity indicatory.
property
Global Queues (Deprecated)
-
+ sharedQueueReturns the global queue
-
+ setSharedQueue:Sets the global queue
Properties
concurrentRequestsLimit
The number of concurrent requests supported by this queue.
@property (nonatomic) NSUInteger concurrentRequestsLimitDiscussion
Default: 5 concurrent requests
Declared In
RKRequestQueue.hcount
Returns the total number of requests in the queue.
@property (nonatomic, readonly) NSUInteger countDeclared In
RKRequestQueue.hdelegate
The delegate to inform when the request queue state machine changes.
@property (nonatomic, assign) id<> delegateDiscussion
If the object implements the RKRequestQueueDelegate protocol, it will receive request lifecycle event messages.
Declared In
RKRequestQueue.hloadingCount
Returns the total number of requests that are currently loading.
@property (nonatomic, readonly) NSUInteger loadingCountDeclared In
RKRequestQueue.hname
A symbolic name for the queue.
@property (nonatomic, retain, readonly) NSString *nameDiscussion
Used to return existing queue references via [RKRequestQueue requestQueueWithName:]
Declared In
RKRequestQueue.hrequestTimeout
Request timeout value used by the queue.
@property (nonatomic, assign) NSUInteger requestTimeoutDiscussion
Default: 5 minutes (300 seconds)
Declared In
RKRequestQueue.hshowsNetworkActivityIndicatorWhenBusy
Sets the flag for showing the network activity indicatory.
@property (nonatomic) BOOL showsNetworkActivityIndicatorWhenBusyDiscussion
When YES, this queue will spin the network activity in the menu bar when it is processing requests.
Default: NO
Declared In
RKRequestQueue.hsuspended
Sets the flag that determines if new load requests are allowed to reach the network.
@property (nonatomic) BOOL suspendedDiscussion
Because network requests tend to slow down performance, this property can be used to temporarily delay them. All requests made while suspended are queued, and when suspended becomes false again they are executed.
Declared In
RKRequestQueue.hClass Methods
newRequestQueueWithName:
Returns a new retained request queue with the given name. If there is already an existing queue with the given name, nil will be returned.
+ (id)newRequestQueueWithName:(NSString *)nameParameters
- name
A symbolic name for the queue.
Return Value
A new retained RKRequestQueue with the given name or nil if one already exists with the given name.
Declared In
RKRequestQueue.hrequestQueue
Creates and returns a new request queue.
+ (id)requestQueueReturn Value
An autoreleased RKRequestQueue object.
Declared In
RKRequestQueue.hrequestQueueExistsWithName:
Determine if a queue exists with a given name.
+ (BOOL)requestQueueExistsWithName:(NSString *)nameParameters
- name
The queue name to search against.
Return Value
YES when there is a queue with the given name.
Declared In
RKRequestQueue.hrequestQueueWithName:
Returns queue with the specified name. If no queue is found with the name provided, a new queue will be initialized and returned.
+ (id)requestQueueWithName:(NSString *)nameParameters
- name
A symbolic name for the queue.
Return Value
An existing RKRequestQueue with the given name or a new queue if none currently exist.
Declared In
RKRequestQueue.hsetSharedQueue:
Sets the global queue
+ (void)setSharedQueue:(RKRequestQueue *)requestQueueParameters
- requestQueue
The request queue to assign as the global queue.
Discussion
Bug: DEPRECATED in v0.10.0: All RKClient instances now own their own individual request queues.
See Also
Declared In
RKRequestQueue.hsharedQueue
Returns the global queue
+ (RKRequestQueue *)sharedQueueReturn Value
Global request queue.
Discussion
Bug: DEPRECATED in v0.10.0: All RKClient instances now own their own individual request queues.
See Also
Declared In
RKRequestQueue.hInstance Methods
abortRequestsWithDelegate:
Aborts all requests with a given delegate by nullifying the delegate reference and canceling the request.
- (void)abortRequestsWithDelegate:(id<RKRequestDelegate>)delegateParameters
- delegate
The object acting as the delegate for all enqueued requests that are to be aborted.
Discussion
Useful when an object that acts as the delegate for one or more requests is being deallocated and all outstanding requests should be cancelled without generating any further delegate callbacks.
Declared In
RKRequestQueue.haddRequest:
Add an asynchronous request to the queue and send it as as soon as possible.
- (void)addRequest:(RKRequest *)requestParameters
- request
The request to be added to the queue.
Declared In
RKRequestQueue.hcancelAllRequests
Cancel all active or pending requests.
- (void)cancelAllRequestsDeclared In
RKRequestQueue.hcancelRequest:
Cancel a request that is in progress.
- (void)cancelRequest:(RKRequest *)requestParameters
- request
The request to be cancelled.
Declared In
RKRequestQueue.hcancelRequestsWithDelegate:
Cancel all requests with a given delegate.
- (void)cancelRequestsWithDelegate:(id<RKRequestDelegate>)delegateParameters
- delegate
The delegate assigned to the requests to be cancelled.
Declared In
RKRequestQueue.h