Unique task queue task names only for active duration
Posted
by antony.trupe
on Stack Overflow
See other posts from Stack Overflow
or by antony.trupe
Published on 2010-05-13T01:04:43Z
Indexed on
2010/05/13
1:14 UTC
Read the original article
Hit count: 271
I want to guarantee that a task is not in a task queue more then once, so I generate a unique name based on it's payload. But, that task name is reserved for up to 7 days, which is not what I want; I only want it reserved for the duration the task is queued; it could be immediately re-queued.
Once a Task with name N is written, any subsequent attempts to insert a Task named N will fail. Eventually (at least seven days after the task successfully executes), the task will be deleted and the name N can be reused.
Is there a way to check if the named task is already in the queue then add it if it's not? Or a totally different approach?
© Stack Overflow or respective owner