![]() |
App Engine Python SDK
v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
|
Public Member Functions | |
def | __init__ |
def | StartBackgroundExecution |
def | Shutdown |
def | GetQueues |
def | GetTasks |
def | DeleteTask |
def | FlushQueue |
def | get_filtered_tasks |
![]() | |
def | __init__ |
def | CreateRPC |
def | MakeSyncCall |
def | SetError |
Additional Inherited Members | |
![]() | |
request_data | |
![]() | |
THREADSAFE = False | |
Python only task queue service stub. This stub executes tasks when enabled by using the dev_appserver's AddEvent capability. When task running is disabled this stub will store tasks for display on a console, where the user may manually execute the tasks.
def google.appengine.api.taskqueue.taskqueue_stub.TaskQueueServiceStub.__init__ | ( | self, | |
service_name = 'taskqueue' , |
|||
root_path = None , |
|||
auto_task_running = False , |
|||
task_retry_seconds = 30 , |
|||
_all_queues_valid = False , |
|||
default_http_server = None , |
|||
_testing_validate_state = False , |
|||
request_data = None |
|||
) |
Constructor. Args: service_name: Service name expected for all calls. root_path: Root path to the directory of the application which may contain a queue.yaml file. If None, then it's assumed no queue.yaml file is available. auto_task_running: When True, the dev_appserver should automatically run tasks after they are enqueued. task_retry_seconds: How long to wait between task executions after a task fails. _testing_validate_state: Should this stub and all of its _Groups (and thus and all of its _Queues) validate their state after each operation? This should only be used during testing of the taskqueue_stub. request_data: A request_info.RequestInfo instance used to look up state associated with the request that generated an API call.
def google.appengine.api.taskqueue.taskqueue_stub.TaskQueueServiceStub.DeleteTask | ( | self, | |
queue_name, | |||
task_name | |||
) |
Deletes a task from a queue, without leaving a tombstone. Args: queue_name: the name of the queue to delete the task from. task_name: the name of the task to delete.
def google.appengine.api.taskqueue.taskqueue_stub.TaskQueueServiceStub.FlushQueue | ( | self, | |
queue_name | |||
) |
Removes all tasks from a queue, without leaving tombstones. Args: queue_name: the name of the queue to remove tasks from.
def google.appengine.api.taskqueue.taskqueue_stub.TaskQueueServiceStub.get_filtered_tasks | ( | self, | |
url = None , |
|||
name = None , |
|||
queue_names = None |
|||
) |
Get the tasks in the task queue with filters. Args: url: A URL that all returned tasks should point at. name: The name of all returned tasks. queue_names: A list of queue names to retrieve tasks from. If left blank this will get default to all queues available. Returns: A list of taskqueue.Task objects.
def google.appengine.api.taskqueue.taskqueue_stub.TaskQueueServiceStub.GetQueues | ( | self | ) |
Gets all the application's queues. Returns: A list of dictionaries, where each dictionary contains one queue's attributes. E.g.: [{'name': 'some-queue', 'max_rate': '1/s', 'bucket_size': 5, 'oldest_task': '2009/02/02 05:37:42', 'eta_delta': '0:00:06.342511 ago', 'tasks_in_queue': 12}, ...] The list of queues always includes the default queue.
def google.appengine.api.taskqueue.taskqueue_stub.TaskQueueServiceStub.GetTasks | ( | self, | |
queue_name | |||
) |
Gets a queue's tasks. Args: queue_name: Queue's name to return tasks for. Returns: A list of dictionaries, where each dictionary contains one task's attributes. E.g. [{'name': 'task-123', 'queue_name': 'default', 'url': '/update', 'method': 'GET', 'eta': '2009/02/02 05:37:42', 'eta_delta': '0:00:06.342511 ago', 'body': '', 'headers': [('user-header', 'some-value') ('X-AppEngine-QueueName': 'update-queue'), ('X-AppEngine-TaskName': 'task-123'), ('X-AppEngine-TaskRetryCount': '0'), ('X-AppEngine-TaskETA': '1234567890.123456'), ('X-AppEngine-Development-Payload': '1'), ('Content-Length': 0), ('Content-Type': 'application/octet-stream')] Raises: ValueError: A task request contains an unknown HTTP method type. KeyError: An invalid queue name was specified.
def google.appengine.api.taskqueue.taskqueue_stub.TaskQueueServiceStub.Shutdown | ( | self | ) |
Requests the task scheduler to shutdown.
def google.appengine.api.taskqueue.taskqueue_stub.TaskQueueServiceStub.StartBackgroundExecution | ( | self | ) |
Start automatic task execution.