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

Class Methods

Field Detail

SC.Request.manager.inflight Array
Current requests that are inflight.
Default value:
[]
SC.Request.manager.maxRequests Number
Maximum number of concurrent requests allowed. 6 for all browsers.
Default value:
6
SC.Request.manager.pending Array
Requests that are pending and have not been started yet.
Default value:
[]

Class Method Detail

cancel(response)

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
cancelAll()
Cancels all inflight and pending requests.
Returns:
Boolean
YES if any items were cancelled.
fireRequestIfNeeded()

Checks the inflight queue. If there is an open slot, this will move a request from pending to inflight.

Returns:
Object
receiver
isInFlight(response)
Checks if the response is in the inflight queue.
Parameters:
response SC.Response
a response object
Returns:
Boolean
is response in inflight queue
isPending(response)
Checks if the response is in the pending queue.
Parameters:
response SC.Response
a response object
Returns:
Boolean
is response in pending queue
sendRequest(request)

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
transportDidClose(response)

Called by a response/transport object when finishes running. Removes the transport from the queue and kicks off the next one.

Parameters:
response
Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 08 2015 10:02:21 GMT-0600 (CST)