Python 2.7 telah mencapai akhir dukungan
dan akan
dihentikan penggunaannya
pada 31 Januari 2026. Setelah penghentian penggunaan, Anda tidak akan dapat men-deploy aplikasi Python 2.7, meskipun organisasi Anda sebelumnya menggunakan kebijakan organisasi untuk mengaktifkan kembali deployment runtime lama. Aplikasi Python 2.7 yang ada akan terus berjalan dan menerima traffic setelah
tanggal penghentiannya. Sebaiknya Anda
bermigrasi ke versi Python terbaru yang didukung.
Membuat Tugas Pull
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Setelah membuat pull queue, Anda
dapat membuat tugas dan menambahkannya ke antrean.
Pertama-tama, Anda memerlukan nama antrean, yang ditentukan dalam queue.yaml
.
Lalu, Anda menetapkan Tugas method
ke PULL
.
Contoh berikut menempatkan tugas dalam pull queue bernama 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)
Langkah berikutnya
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-09-04 UTC.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 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)."]]