App Engine Python SDK  v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
Public Member Functions | Public Attributes | List of all members
google.appengine.ext.remote_api.throttle.ThrottleHandler Class Reference
Inheritance diagram for google.appengine.ext.remote_api.throttle.ThrottleHandler:

Public Member Functions

def __init__
 
def AddRequest
 
def AddResponse
 
def http_request
 
def https_request
 
def http_response
 
def https_response
 

Public Attributes

 throttle
 

Detailed Description

A urllib2 handler for http and https requests that adds to a throttle.

Constructor & Destructor Documentation

def google.appengine.ext.remote_api.throttle.ThrottleHandler.__init__ (   self,
  throttle 
)
Initialize a ThrottleHandler.

Args:
  throttle: A Throttle instance to call for bandwidth and http/https request
throttling.

Member Function Documentation

def google.appengine.ext.remote_api.throttle.ThrottleHandler.AddRequest (   self,
  throttle_name,
  req 
)
Add to bandwidth throttle for given request.

Args:
  throttle_name: The name of the bandwidth throttle to add to.
  req: The request whose size will be added to the throttle.
def google.appengine.ext.remote_api.throttle.ThrottleHandler.AddResponse (   self,
  throttle_name,
  res 
)
Add to bandwidth throttle for given response.

Args:
  throttle_name: The name of the bandwidth throttle to add to.
  res: The response whose size will be added to the throttle.
def google.appengine.ext.remote_api.throttle.ThrottleHandler.http_request (   self,
  req 
)
Process an HTTP request.

If the throttle is over quota, sleep first.  Then add request size to
throttle before returning it to be sent.

Args:
  req: A urllib2.Request object.

Returns:
  The request passed in.
def google.appengine.ext.remote_api.throttle.ThrottleHandler.http_response (   self,
  unused_req,
  res 
)
Process an HTTP response.

The size of the response is added to the bandwidth throttle and the request
throttle is incremented by one.

Args:
  unused_req: The urllib2 request for this response.
  res: A urllib2 response object.

Returns:
  The response passed in.
def google.appengine.ext.remote_api.throttle.ThrottleHandler.https_request (   self,
  req 
)
Process an HTTPS request.

If the throttle is over quota, sleep first.  Then add request size to
throttle before returning it to be sent.

Args:
  req: A urllib2.Request object.

Returns:
  The request passed in.
def google.appengine.ext.remote_api.throttle.ThrottleHandler.https_response (   self,
  unused_req,
  res 
)
Process an HTTPS response.

The size of the response is added to the bandwidth throttle and the request
throttle is incremented by one.

Args:
  unused_req: The urllib2 request for this response.
  res: A urllib2 response object.

Returns:
  The response passed in.

The documentation for this class was generated from the following file: