Hi Ian, On Mon, Nov 22, 2010 at 11:10 AM, Ian Lewis <[email protected]> wrote:
> While the task name thing should generally work, they don't provide a > guarantee that inserting the task > won't succeed more than once. > A named task will never be duplicated - that's the point of task names - though any task at all may be executed more than once. > Also, I don't particularly want to have to add a task to check if it is > inserted. > Supposing there was a way to check if a task exists, what would you do if you perform the check and it does not exist? > There is also the problem of tombstoning names, so I would need to come up > with unique task names that > could be computed by the cron job. > > > http://code.google.com/appengine/docs/python/taskqueue/overview.html#Worker_URLs_and_Task_Names > You should always do this anyway - naming your tasks after the time interval or iteration number they're for - because doing otherwise introduces race conditions. -Nick Johnson > > I thought about using a heartbeat to check but I'm a bit afraid of > contention issues. The heartbeat option > seems like it would be the most straight forward though. > > Ian > > > On Mon, Nov 22, 2010 at 8:27 AM, vlad <[email protected]> wrote: > >> Agree with Robert named tasks are the way to go. I have a similar >> requirements - have a long running state machine implemented as >> chained tasks. Once I worked out transactional issues and added >> "choke" points to prevent fork bomb it has been running ok for over 1 >> week now. Clarification, by "running ok" I meant that task flow is >> sustained in presence of occasional datastore and memcache errors. You >> task handlers and app as a whole should still deal with idempotancy >> issues arising from errors. >> >> On Nov 21, 5:07 am, Remigius <[email protected]> wrote: >> > Ian, >> > >> > It does not look like there's a facility to look up queued tasks in >> > the task queue API. Instead you could use a heartbeat in the data >> > store (i.e. save an entity with a timestamp each time the task queue >> > task runs) that is checked by the cron job. >> > >> > Cheers, Remigius. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Google App Engine" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]<google-appengine%[email protected]> >> . >> For more options, visit this group at >> http://groups.google.com/group/google-appengine?hl=en. >> >> > > > -- > Ian > > http://www.ianlewis.org/ > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-appengine%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-appengine?hl=en. > -- Nick Johnson, Developer Programs Engineer, App Engine Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number: 368047 -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
