ee.data.newTaskId
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
สร้างรหัส "ยังไม่ได้ส่ง" สำหรับงานที่ใช้เวลานาน
ก่อนส่งงาน ระบบอาจกำหนดรหัสเพื่อติดตามงาน เซิร์ฟเวอร์จะตรวจสอบว่าไม่สามารถนำรหัสเดียวกันกลับมาใช้ซ้ำได้ รหัสเหล่านี้มีรูปแบบ UUID คือ xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
งานที่ทำงานบนเซิร์ฟเวอร์จะมีรหัสที่ไม่มีขีดกลาง ซึ่งจะแสดงผลโดย ee.data.startProcessing และวิธีการแบบกลุ่มอื่นๆ
แสดงผลอาร์เรย์ที่มีสตริงรหัสที่สร้างขึ้น หรือ Null หากมีการระบุการเรียกกลับ
การใช้งาน | การคืนสินค้า |
---|
ee.data.newTaskId(count, callback) | List<String> |
อาร์กิวเมนต์ | ประเภท | รายละเอียด |
---|
count | หมายเลข (ไม่บังคับ) | จำนวนรหัสที่จะสร้าง โดยค่าเริ่มต้นคือ 1 |
callback | ฟังก์ชัน (ไม่บังคับ) | การเรียกกลับที่ไม่บังคับ หากไม่ได้ระบุไว้ ระบบจะโทรแบบพร้อมกัน |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[[["\u003cp\u003eGenerates unique, unsubmitted IDs for pre-submission tracking of long-running tasks.\u003c/p\u003e\n"],["\u003cp\u003eThese IDs follow a UUID format (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) and are guaranteed to be unique by the server.\u003c/p\u003e\n"],["\u003cp\u003eRunning tasks on the server have IDs without hyphens, distinct from these pre-submission IDs.\u003c/p\u003e\n"],["\u003cp\u003eThe function \u003ccode\u003eee.data.newTaskId()\u003c/code\u003e generates these IDs and returns them as an array or via a callback.\u003c/p\u003e\n"]]],[],null,["# ee.data.newTaskId\n\n\u003cbr /\u003e\n\nGenerates an \"unsubmitted\" ID for a long-running task.\n\n\u003cbr /\u003e\n\nBefore tasks are submitted, they may be assigned IDs to track them. The server ensures that the same ID cannot be reused. These IDs have a UUID format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.\n\nTasks that are running on the server have a ID without hyphens. This is returned by ee.data.startProcessing and other batch methods.\n\nReturns an array containing generated ID strings, or null if a callback is specified.\n\n| Usage | Returns |\n|-----------------------------------------------|----------------|\n| `ee.data.newTaskId(`*count* `, `*callback*`)` | List\\\u003cString\\\u003e |\n\n| Argument | Type | Details |\n|------------|--------------------|------------------------------------------------------------------------|\n| `count` | Number, optional | The number of IDs to generate, one by default. |\n| `callback` | Function, optional | An optional callback. If not supplied, the call is made synchronously. |"]]