App Engine Python SDK  v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
Public Member Functions | List of all members
google.appengine.tools.old_dev_appserver.HTTPServerWithScheduler Class Reference
Inheritance diagram for google.appengine.tools.old_dev_appserver.HTTPServerWithScheduler:
google.appengine.tools.old_dev_appserver.HttpServerWithMultiProcess

Public Member Functions

def __init__
 
def handle_request
 
def get_request
 
def serve_forever
 
def stop_serving_forever
 
def AddEvent
 
def UpdateEvent
 

Detailed Description

A BaseHTTPServer subclass that calls a method at a regular interval.

Constructor & Destructor Documentation

def google.appengine.tools.old_dev_appserver.HTTPServerWithScheduler.__init__ (   self,
  server_address,
  request_handler_class 
)
Constructor.

Args:
  server_address: the bind address of the server.
  request_handler_class: class used to handle requests.

Member Function Documentation

def google.appengine.tools.old_dev_appserver.HTTPServerWithScheduler.AddEvent (   self,
  eta,
  runnable,
  service = None,
  event_id = None 
)
Add a runnable event to be run at the specified time.

Args:
  eta: when to run the event, in seconds since epoch.
  runnable: a callable object.
  service: the service that owns this event. Should be set if id is set.
  event_id: optional id of the event. Used for UpdateEvent below.
def google.appengine.tools.old_dev_appserver.HTTPServerWithScheduler.get_request (   self,
  time_func = time.time,
  select_func = select.select 
)
Overrides the base get_request call.

Args:
  time_func: used for testing.
  select_func: used for testing.

Returns:
  a (socket_object, address info) tuple.
def google.appengine.tools.old_dev_appserver.HTTPServerWithScheduler.handle_request (   self)
Override the base handle_request call.

Python 2.6 changed the semantics of handle_request() with r61289.
This patches it back to the Python 2.5 version, which has
helpfully been renamed to _handle_request_noblock.
def google.appengine.tools.old_dev_appserver.HTTPServerWithScheduler.serve_forever (   self)
Handle one request at a time until told to stop.
def google.appengine.tools.old_dev_appserver.HTTPServerWithScheduler.stop_serving_forever (   self)
Stop the serve_forever() loop.

Stop happens on the next handle_request() loop; it will not stop
immediately.  Since dev_appserver.py must run on py2.5 we can't
use newer features of SocketServer (e.g. shutdown(), added in py2.6).
def google.appengine.tools.old_dev_appserver.HTTPServerWithScheduler.UpdateEvent (   self,
  service,
  event_id,
  eta 
)
Update a runnable event in the heap with a new eta.
TODO: come up with something better than a linear scan to
update items. For the case this is used for now -- updating events to
"time out" channels -- this works fine because those events are always
soon (within seconds) and thus found quickly towards the front of the heap.
One could easily imagine a scenario where this is always called for events
that tend to be at the back of the heap, of course...

Args:
  service: the service that owns this event.
  event_id: the id of the event.
  eta: the new eta of the event.

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