Crea tareas de extracción
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Una vez que creaste una lista de extracción, puedes crear tareas y agregarlas a la fila.
Primero, necesitas el nombre de la cola, que se define en queue.yaml
.
Luego, configura el method
Task como PULL
.
En el siguiente ejemplo, se colocan tareas en una lista de extracción llamada pull-queue
:
from google.appengine.api import taskqueue
q = taskqueue.Queue('pull-queue')
tasks = []
payload_str = 'hello world'
tasks.append(taskqueue.Task(payload=payload_str, method='PULL'))
q.add(tasks)
¿Qué sigue?
Salvo que se indique lo contrario, el contenido de esta página está sujeto a la licencia Atribución 4.0 de Creative Commons, y los ejemplos de código están sujetos a la licencia Apache 2.0. Para obtener más información, consulta las políticas del sitio de Google Developers. Java es una marca registrada de Oracle o sus afiliados.
Última actualización: 2025-09-04 (UTC)
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-04 (UTC)"],[[["\u003cp\u003ePull queues allow you to create and add tasks, as demonstrated in the provided example.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003equeue.yaml\u003c/code\u003e file contains the name of the queue, which is necessary for adding tasks.\u003c/p\u003e\n"],["\u003cp\u003eTasks in a pull queue are created by setting the \u003ccode\u003emethod\u003c/code\u003e to \u003ccode\u003ePULL\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe API is compatible with first-generation runtimes and can be used when upgrading to second-generation runtimes.\u003c/p\u003e\n"]]],[],null,["# Creating Pull Tasks\n\nOnce you have [created a pull\nqueue](/appengine/docs/legacy/standard/python/taskqueue/pull/creating-pull-queues), you\ncan create tasks and add them to the queue.\n| This API is supported for first-generation runtimes and can be used when [upgrading to corresponding second-generation runtimes](/appengine/docs/standard/\n| python3\n|\n| /services/access). If you are updating to the App Engine Python 3 runtime, refer to the [migration guide](/appengine/migration-center/standard/migrate-to-second-gen/python-differences) to learn about your migration options for legacy bundled services.\n\nFirst you need the [name](/appengine/docs/legacy/standard/python/config/queueref#name)\nof the queue, which is defined\nin `queue.yaml`.\nThen you set the\n[Task](/appengine/docs/legacy/standard/python/refdocs/google.appengine.api.taskqueue.taskqueue#google.appengine.api.taskqueue.taskqueue.Task)\n`method` to `PULL`.\n\n\nThe following example puts tasks in a pull queue named `pull-queue`: \n\n from google.appengine.api import taskqueue\n\n q = taskqueue.Queue('pull-queue')\n tasks = []\n payload_str = 'hello world'\n tasks.append(taskqueue.Task(payload=payload_str, method='PULL'))\n q.add(tasks)\n\nWhat's next\n-----------\n\n- Learn how to [lease tasks](/appengine/docs/legacy/standard/python/taskqueue/pull/leasing-pull-tasks)."]]