A BaseHTTPServer subclass that calls a method at a regular interval.
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.
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:
- code/googleappengine-read-only/python/google/appengine/tools/old_dev_appserver.py