Pull-Aufgaben erstellen
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Nach dem Erstellen einer Pull-Warteschlange können Sie Aufgaben erstellen und der Warteschlange hinzufügen.
Zuerst benötigen Sie den Namen der Warteschlange, der in queue.yaml
definiert ist.
Dann legen Sie für Method
den Wert PULL
fest.
Im folgenden Beispiel werden Aufgaben in eine Pull-Warteschlange mit dem Namen pull-queue
gestellt.
Nächste Schritte
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-09-04 (UTC).
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-04 (UTC)."],[[["\u003cp\u003ePull queues require prior creation before tasks can be added.\u003c/p\u003e\n"],["\u003cp\u003eThe queue's name, defined in \u003ccode\u003equeue.yaml\u003c/code\u003e, is necessary for adding tasks.\u003c/p\u003e\n"],["\u003cp\u003eSetting the \u003ccode\u003eMethod\u003c/code\u003e to \u003ccode\u003ePULL\u003c/code\u003e is required when adding tasks to a pull queue.\u003c/p\u003e\n"],["\u003cp\u003eTasks are added to a pull queue using \u003ccode\u003etaskqueue.Add\u003c/code\u003e, as demonstrated in the example with \u003ccode\u003epull-queue\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Creating Pull Tasks\n\nOnce you have [created a pull\nqueue](/appengine/docs/legacy/standard/go111/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| go\n| /services/access). If you are updating to the App Engine Go 1.12+ runtime, refer to the [migration guide](/appengine/migration-center/standard/migrate-to-second-gen/go-differences) to learn about your migration options for legacy bundled services.\n\nFirst you need the [name](/appengine/docs/legacy/standard/go111/config/queueref#name)\nof the queue, which is defined\nin `queue.yaml`.\n\n\nThen you set `Method` to `PULL`.\n\nThe following example puts tasks in a pull queue named `pull-queue`: \n\n t := &taskqueue.Task{\n \tPayload: []byte(\"hello world\"),\n \tMethod: \"PULL\",\n }\n _, err := taskqueue.Add(ctx, t, \"pull-queue\")\n\nWhat's next\n-----------\n\n- Learn how to [lease tasks](/appengine/docs/legacy/standard/go111/taskqueue/pull/leasing-pull-tasks)."]]