Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Kode berikut membuat tugas yang akan dikirim sebagai permintaan POST ke pengendali /worker aplikasi. Tugas berisi data nama dan tindakan, serta akan diproses oleh antrean default:
Anda juga dapat menambahkan tugas secara massal ke antrean menggunakan PushQueue. Dalam contoh berikut, dua objek PushTask ditambahkan ke PushQueue menggunakan metode addTasks().
$task1 = new PushTask('/someUrl');$task2 = new PushTask('/someOtherUrl');$queue = new PushQueue();$queue->addTasks([$task1, $task2]);
Saat Anda menggunakan PushTask dan PushQueue, sertakan pernyataan berikut di bagian atas file PHP Anda:
use google\appengine\api\taskqueue\PushTask;use google\appengine\api\taskqueue\PushQueue;
[[["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-03-06 UTC."],[[["This page provides instructions on using legacy bundled services and APIs, specifically within the first-generation runtimes of the App Engine standard environment."],["A task can be created and sent as a POST request to a designated handler using the `PushTask` class, including the name and action parameters that will be processed by the default queue."],["Multiple tasks can be added in bulk to a queue by creating `PushTask` objects and using the `addTasks()` method within the `PushQueue` class."],["To utilize the `PushTask` and `PushQueue` classes, you must include specific `use` statements at the beginning of your PHP file."]]],[]]