[google-appengine] Re: there may be something wrong with put_async
You should read the docs a bit more. In the intro to async operations it even says In this example, it's a little silly to call future.get_result: the application never *uses* the result from NDB. That code is just in there to make sure that the request handler doesn't exit before the NDB put finishes; if the request handler exits too early, the put might never happen. As a convenience, you can decorate the request handler with@ndb.toplevel. This tells the handler not to exit until its asynchronous requests have finished. This in turn lets you send off the request and not worry about the result. https://developers.google.com/appengine/docs/python/ndb/async On Wednesday, April 9, 2014 11:26:07 PM UTC+8, saintthor wrote: model.put_async() then return. without calling Future.get_result(). shouldn't the model be written to datastore? -- 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 google-appengine+unsubscr...@googlegroups.com. To post to this group, send email to google-appengine@googlegroups.com. Visit this group at http://groups.google.com/group/google-appengine. For more options, visit https://groups.google.com/d/optout.
[google-appengine] Re: there may be something wrong with put_async
thanks. 在 2014年4月10日星期四UTC+8上午6时47分43秒,timh写道: You should read the docs a bit more. In the intro to async operations it even says In this example, it's a little silly to call future.get_result: the application never *uses* the result from NDB. That code is just in there to make sure that the request handler doesn't exit before the NDB put finishes; if the request handler exits too early, the put might never happen. As a convenience, you can decorate the request handler with@ndb.toplevel. This tells the handler not to exit until its asynchronous requests have finished. This in turn lets you send off the request and not worry about the result. https://developers.google.com/appengine/docs/python/ndb/async On Wednesday, April 9, 2014 11:26:07 PM UTC+8, saintthor wrote: model.put_async() then return. without calling Future.get_result(). shouldn't the model be written to datastore? -- 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 google-appengine+unsubscr...@googlegroups.com. To post to this group, send email to google-appengine@googlegroups.com. Visit this group at http://groups.google.com/group/google-appengine. For more options, visit https://groups.google.com/d/optout.