laravel-google-cloud-tasks-queue icon indicating copy to clipboard operation
laravel-google-cloud-tasks-queue copied to clipboard

Leverage Google Cloud Task deduplication mechanism

Open jfradj opened this issue 1 year ago • 0 comments

This PR allows a job to define a cloud task id and thus leverage the powerful Google Cloud Task deduplication mechanism.

Indeed Google provide a guarantee deduplication mechanism

Explicitly specifying a 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 fail

Right now, the task id (i.e. task name) is build using a ULID, so each submitted job will have its own unique id. Which is great most of the time. But doing so totally prevents the use of the deduplication feature.

With this PR, any Job defining a class property public string $cloudTaskId; will be able to have control on the submitted task id and be able to rely on the deduplication feature.

jfradj avatar Dec 20 '24 06:12 jfradj