PHP 5 telah mencapai akhir dukungan dan akan
dihentikan penggunaannya
pada 31 Januari 2026. Setelah penghentian penggunaan, Anda tidak akan dapat men-deploy aplikasi PHP 5, meskipun organisasi Anda sebelumnya menggunakan kebijakan organisasi untuk mengaktifkan kembali deployment runtime lama. Aplikasi PHP 5 yang sudah ada akan terus berjalan dan menerima traffic setelah
tanggal penghentiannya. Sebaiknya Anda
bermigrasi ke versi PHP terbaru yang didukung.
Menggunakan Push Queue di PHP
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Halaman ini menyediakan ringkasan mengenai push queue. Push queue menjalankan tugas dengan mengirim permintaan HTTP ke layanan worker App Engine. Permintaan dikirim dengan kecepatan yang konstan. Jika tugas gagal, layanan akan mencoba kembali tugas tersebut,
dengan mengirimkan permintaan lain. Anda harus menyediakan pengendali untuk setiap jenis tugas yang Anda gunakan. Satu layanan dapat memiliki beberapa pengendali untuk berbagai jenis tugas, atau Anda dapat menggunakan layanan yang berbeda untuk mengelola jenis tugas yang berbeda.

Tenggat waktu tugas
Saat menerima permintaan tugas push, layanan worker harus menangani permintaan tersebut dan mengirim respons HTTP sebelum batas waktu yang bergantung pada jenis penskalaan layanan worker.
Layanan penskalaan otomatis harus selesai sebelum 10 menit berlalu.
Layanan penskalaan manual dan dasar dapat berjalan hingga 24 jam.
Kode respons HTTP dengan rentang antara 200–299 menunjukkan keberhasilan; nilai lainnya mengindikasikan bahwa tugas gagal. Jika tugas gagal merespons dalam batas waktu yang diberikan, atau
menampilkan nilai respons yang tidak valid, tugas akan dicoba ulang.
Mencoba ulang tugas yang gagal
Jika pengendali permintaan tugas push menampilkan kode status HTTP di luar rentang 200–299, atau gagal menampilkan respons apa pun sebelum batas waktu tugas terlampaui, antrean akan mencoba ulang tugas tersebut hingga berhasil. Sistem melakukan backoff secara bertahap agar aplikasi tidak dipenuhi dengan terlalu banyak permintaan. Namun, sistem akan menjadwalkan upaya percobaan ulang untuk tugas yang gagal agar dilakukan minimal sekali per jam.
Menangani push queue
Saat menangani push queue, setidaknya Anda perlu melakukan hal-hal berikut:
Secara opsional, Anda juga dapat:
Saat Anda menggunakan push queue, aplikasi Anda tunduk pada kuota tambahan.
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-08-19 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-08-19 UTC."],[[["\u003cp\u003ePush queues manage tasks by sending HTTP requests to App Engine worker services at a consistent rate, retrying the tasks if they fail.\u003c/p\u003e\n"],["\u003cp\u003eEach task requires a designated handler, which can be part of a single service with multiple handlers or managed by different services for various task types.\u003c/p\u003e\n"],["\u003cp\u003eThe deadline for a worker service to process a push task ranges from 10 minutes for automatic scaling to up to 24 hours for manual and basic scaling services, where HTTP responses between 200-299 are considered successful.\u003c/p\u003e\n"],["\u003cp\u003eWorking with push queues involves programmatically creating tasks and assigning handlers to process them, with the option to create and customize multiple queues for efficiency.\u003c/p\u003e\n"],["\u003cp\u003eIf a task's HTTP status code is outside the 200-299 range or fails to respond within the deadline, the queue will retry it, with a minimum of once per hour, and all usage is subjected to usage quotas.\u003c/p\u003e\n"]]],[],null,["# Using Push Queues in PHP\n\nThis page provides an overview of push queues. Push queues run tasks by\ndispatching HTTP requests to App Engine worker services. The requests are\ndelivered at a constant rate. If a task fails, the service retries the task,\nsending another request. You must provide a handler for every kind of task you\nuse. A single service can have multiple handlers for different kinds of tasks, or\nyou can use different services to manage different task types.\n| This API is supported for first-generation runtimes and can be used when [upgrading to corresponding second-generation runtimes](/appengine/docs/standard/\n| php-gen2\n|\n| /services/access). If you are updating to the App Engine PHP 7/8 runtime, refer to the [migration guide](/appengine/migration-center/standard/migrate-to-second-gen/php-differences) to learn about your migration options for legacy bundled services.\n\nThe task deadline\n-----------------\n\nWhen a worker service receives a push task request, it must handle the request\nand send an HTTP response before a deadline that depends on the [scaling\ntype](/appengine/docs/legacy/standard/php/an-overview-of-app-engine#instances)\nof the worker service.\n\nAutomatic scaling services must finish before 10 minutes have elapsed.\nManual and basic scaling services can run up to 24 hours.\n\nAn HTTP response code between 200--299 indicates success; all other values\nindicate the task failed. If the task fails to respond within the deadline, or\nreturns an invalid response value, the task is retried.\n\nRetrying a failed task\n----------------------\n\nIf a push task request handler returns an HTTP status code outside the range\n200--299, or fails to return any response before the task deadline occurs, the queue\nretries the task until it succeeds. The system backs off gradually to\navoid flooding your application with too many requests, but schedules retry\nattempts for failed tasks to recur at a minimum of once per hour.\n\nWorking with push queues\n------------------------\n\nWhen working with push queues, at a minimum, you'll need to do the following things:\n\n- [Create tasks\n programmatically](/appengine/docs/legacy/standard/php/taskqueue/push/creating-tasks) and add them to the default push queue, or to one or more named push queues that you have created.\n- [Write a\n handler](/appengine/docs/legacy/standard/php/taskqueue/push/creating-handlers) that processes a task's request, and assign the handler to an App Engine service.\n\nOptionally, you can also:\n\n- [Create and customize multiple\n queues](/appengine/docs/legacy/standard/php/taskqueue/push/creating-push-queues) to perform multiple tasks efficiently.\n- [Monitor and manage](/appengine/docs/legacy/standard/php/taskqueue/push/creating-push-queues#monitoring_queues_in_the_console_name_short) your push queues in the Google Cloud console.\n\nWhen you use push queues, your application is subject to additional\n[quotas](/appengine/docs/quotas#Task_Queue).\n\nWhat's next\n-----------\n\n- Learn how to [create push queues](/appengine/docs/legacy/standard/php/taskqueue/push/creating-push-queues)\n- Learn how to [create tasks](/appengine/docs/legacy/standard/php/taskqueue/push/creating-tasks)\n- Learn about [writing handlers](/appengine/docs/legacy/standard/php/taskqueue/push/creating-handlers)\n- Look at an [example](/appengine/docs/legacy/standard/php/taskqueue/push/example)"]]