Class: SC.Request.manager
The request manager coordinates all of the active XHR requests. It will only allow a certain number of requests to be active at a time; queuing any others. This allows you more precise control over which requests load in which order.
Defined in: request.js
- Since:
- SproutCore 1.0
Field Summary
- SC.Request.manager.inflight
- SC.Request.manager.maxRequests
- SC.Request.manager.pending
Class Methods
- cancel(response)
- cancelAll()
- fireRequestIfNeeded()
- isInFlight(response)
- isPending(response)
- sendRequest(request)
- transportDidClose(response)
Field Detail
SC.Request.manager.inflight Array- Default value:
- []
- Default value:
- 6
- Default value:
- []
Class Method Detail
Cancels a specific request. If the request is pending it will simply be removed. Otherwise it will actually be cancelled.
- Parameters:
- response SC.Response
- a response object
- Returns:
- Boolean
- YES if cancelled
- Returns:
- Boolean
- YES if any items were cancelled.
Checks the inflight queue. If there is an open slot, this will move a request from pending to inflight.
- Returns:
- Object
- receiver
- Parameters:
- response SC.Response
- a response object
- Returns:
- Boolean
- is response in inflight queue
- Parameters:
- response SC.Response
- a response object
- Returns:
- Boolean
- is response in pending queue
Invoked by the send() method on a request. This will create a new low- level transport object and queue it if needed.
- Parameters:
- request SC.Request
- the request to send
- Returns:
- SC.Object
- response object
Called by a response/transport object when finishes running. Removes the transport from the queue and kicks off the next one.
- Parameters:
- response