I am not sure how to handle asynchronous operation in Google App Engine. Can you help me with this code?
I want to put asynchronously entity:
class Thing(ndb.Model):
pass
entity = Thing()
future = entity.put_async()
# hundred of code lines of other async to parallelize
But I am not sure if I should wait on this put before handlers ends?
Should I finish my code with to keep data consistent?
future.wait()
Maybe my question looks trivial but I want avoid random bugs from unpredicted behavior. I read https://cloud.google.com/appengine/docs/python/ndb/futureclass but not found good answer here.
Same here https://cloud.google.com/appengine/docs/python/ndb/async.
put_async()
notput()
. Code is simplified. Do not think that I do not know how to useput()
assume that I have to useput_async()
and hundred of code lines is skipped. – Chameleon