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.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:

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

Java 8

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

Java 7

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

What's next

本頁內容對您是否有任何幫助?請提供意見:

傳送您對下列選項的寶貴意見...

這個網頁
App Engine standard environment for Java