I am trying to throttle the amount that a particular task occurs by delaying
the task for around one minute.
Any subsequent tasks added with the same name within that minute would be
rejected (I know how to do this part).
Do you know how I can achieve this?
Thanks in advance.
--
You receive
You could use the countdown or eta arguments when creating the task.
Note, neither is guaranteed to be respected. For example, if your
queue gets backed up for some reason you might wind up with a large
burst of tasks.
http://code.google.com/appengine/docs/python/taskqueue/tasks.html#Task
You c
Thanks Robert.
Your response has solved one of my problems but highlighted another. I had
mistakenly thought the task name would be available as soon as it executes,
and therefore the name could be used as a key to ensure only one of that
task is queued at a time. Do you know how I can achieve
Hi,
It depends on your actual application. One method is to use some
type of counter that is updated when the task runs, just append the
current count to the task name. In some applications there might be a
'natural' counter you could use, such as a revision count on the
entity you're updating.