id property
The ID to use for the enqueued task.
If not provided, one will be automatically generated.
If provided, an explicitly specified task ID enables task de-duplication. If a task's ID is identical to that of an existing task or a task that was deleted or executed recently then the call will throw an error with code "task-already-exists". Another task with the same ID can't be created for ~1 hour after the original task was deleted or executed.
Because there is an extra lookup cost to identify duplicate task IDs, setting ID significantly increases latency. Using hashed strings for the task ID or for the prefix of the task ID is recommended.
Choosing task IDs that are sequential or have sequential prefixes, for example using a timestamp, causes an increase in latency and error rates in all task commands. The infrastructure relies on an approximately uniform distribution of task IDs to store and serve tasks efficiently.
The ID can contain only letters ([A-Za-z]), numbers ([0-9]), hyphens
(-), or underscores (_). The maximum length is 500 characters.
Implementation
final String? id;