Notice: Over the next few months, we're reorganizing the App Engine documentation site to make it easier to find content and better align with the rest of Google Cloud products. The same content will be available, but the navigation will now match the rest of the Cloud products. If you have feedback or questions as you navigate the site, click Send Feedback.

Creating Pull Tasks

Stay organized with collections Save and categorize content based on your preferences.

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.xml. Then you use the builder and TaskOptions.Method.PULL to add the task. The following example puts tasks in a pull queue named pull-queue:

First, get the queue using the queue name defined in the queue.xml:

Queue q = QueueFactory.getQueue("pull-queue");

Then use the queue's add() method with TaskOptions.Method.PULL to place tasks in a pull queue named pull-queue:

q.add(
    TaskOptions.Builder.withMethod(TaskOptions.Method.PULL).payload(content.toString()));

What's next