On Tue, Sep 10, 2013 at 9:57 PM, Jacob Taylor <[email protected]> wrote:
> Is there a safe way to sleep when using a multi-threaded python > application? We were seeing huge issues when we had a few regular small > sleep statements. i.e. common use cases that were sleeping for 1/4 second. > > Well, that's implementation dependent. Instead of doing sleep, you could move time-consuming application logic to where you need a delay. For instance, suppose you needed to do a urlfetch later on in your code. Why not do a synchronous urlfetch in place of the delay? Or you could use a push task, set it to countdown a short time before executing ( https://developers.google.com/appengine/docs/python/taskqueue/tasks#Task see the countdown option). The push task then notifies whatever service to start leasing tasks from the pull queue. You could also fake it - for example, do a while loop that counts up to an outrageously high number. It's a bit of a waste of instance time, but whatever works! ----------------- -Vinny P Technology & Media Advisor Chicago, IL App Engine Code Samples: http://www.learntogoogleit.com -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-appengine. For more options, visit https://groups.google.com/groups/opt_out.
