Reputation: 1456
During an API call, I schedule a task to be executed n minutes later. I name the task.
Another API call, if executed, will delete the task.
When the task is executed (where all datastore operations are performed in a transaction), it also checks if it needs to wait some more. If so, I would like to complete the task successfully, but also submit a task (to be executed n minutes later) with the same name, so it can still be cancelled by the previously mentioned API call.
I do not see anything in the documentation about a task adding a new task with the same name before completing successfully, or about a task deleting itself and submitting a new task with the same name (especially within a transaction).
(Even if I got it to work, I want to make sure it was due to supported functionality. The system handles real payments.)
Thank you for your input. /Alexander
Upvotes: 1
Views: 283
Reputation: 51
When i have tested use named tasks, i couldn't in a short time create a new task whit the same name, neither in some minutes..., I think you can use a mixture of a cron whit variables stored in a datastore entity, the cron to review each some time the status variables in the datastore and to launch any task if is needed.
Upvotes: 1
Reputation: 12986
As far as I am aware you can't re-use task names for quite some time.
There is no currently defined tombstone time for tasks,
See For how long are task names tombstoned in AppEngine?
See also What is TombstonedTaskError from App Engine's Task Queue? which suggests names are held for up to 7 days.
I think you need to find an alternate method for whatever you are trying to do or elaborate on your use case and maybe there is a better/alternate approach.
Upvotes: 0