Documentation for pulsar 0.7.2. For development docs, go here.
The task queue application does not expose an external API to run new tasks or retrieve task information. The TaskQueueRpcMixin class can be used to achieve just that. It is a pulsar.apps.rpc.JSONRPC handler which exposes six functions for executing tasks and retrieving task information.
The task-queue example shows how to use this class in the context of a WSGI server running along side the task-queue application.
A pulsar.apps.rpc.JSONRPC mixin for communicating with a TaskQueue.
|Parameters:||taskqueue – instance or name of the pulsar.apps.tasks.TaskQueue which exposes the remote procedure calls.|
Return the list of Jobs registered with task queue with meta information. If a list of jobnames is given, it returns only jobs included in the list.
Run a new task in the task queue. The task can be of any type as long as it is registered in the task queue registry. To check the available tasks call the “job_list” function. It returns the task id.
Retrieve a task from its id
Retrieve a list of tasks which satisfy key-valued filters
Wait for a task to have finished.
the json representation of the task once it has finished.
Return the approximate number of tasks in the task queue.
Internal function which returns a dictionary of parameters to be passed to the Task class constructor. This function can be overridden to add information about the type of request, who made the request and so forth. It must return a dictionary. By default it returns an empty dictionary.