Creating Pull Tasks

Once you have created a pull queue, you can create tasks and add them to the queue.

First you need the name of the queue, which is defined in queue.yaml. Then you set the Task method to PULL. The following example puts tasks in a pull queue named pull-queue:

fromgoogle.appengine.apiimport taskqueue
q = taskqueue.Queue('pull-queue')
tasks = []
payload_str = 'hello world'
tasks.append(taskqueue.Task(payload=payload_str, method='PULL'))
q.add(tasks)

What's next

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026年08月26日 UTC.