问题
Once I've got a message from the client, I don't want to reply immediately, I want to wait for a few seconds (random number of seconds). How can I do it? (I use Channel API, so such delay should be OK for the client)
回答1:
You can just make the thread sleep for a while:
import thread
...
thread.sleep(some_number_of_milliseconds)
回答2:
The deferred built-in library would perform better than sleep for App Engine and is easier to setup than Task Queue.
[https://cloud.google.com/appengine/articles/deferred][1]
来源:https://stackoverflow.com/questions/9420223/how-to-implement-delay-in-gae-replies