>From the NDB async docs: 

Furthermore, instead of using acct = key.get() or 
acct = key.get_async().get_result(), the function should useacct = *yield*
 key.get*_async*(). This yield tells NDB that this is a good place to 
suspend this tasklet and let other tasklets run.


Re the second example: get_async().get_result()
I believe I understand why yield works here, and how it lets the system 
return to event loop.

But is calling get_result() just inefficient, or is it actually dangerous, 
because it is effectively a synchronous call in the tasklet, and I'm now 
vulnerable to hard-to-diagnose stack overflows when the event loop is 
recursively invoked (
http://code.google.com/p/appengine-ndb-experiment/issues/detail?id=167)?

Plan to re-write to use yield anyway - just trying to better understand the 
tasklet/async/eventloop system.
Thanks for any insight.
-ck

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/MWaTJ1nl8igJ.
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.

Reply via email to