Hi everyone,

I'm new to python, appengine and this group so please bear with me :)

I have a function that updates a set of entities from different entity 
groups. The set's size will get bigger than the allowed size of cross-group 
transactions. The issue is, this function may get called from within an 
existing transaction.

Now the actual task of the function is not important to the running 
transaction, and so it should be executed outside of it. What's the best 
way to accomplish such a thing without restructuring the existing code?

My current solution (which is quite bad IMO) is to run the worker function 
as a tasklet, then wrap it in an outer function that blocks on the 
tasklet's result. Something like the following (typed in mail):

@ndb.tasklet
def worker_func():
    # do some work
    raise ndb.Return(True)

def wrapper():
    assert worker_func() == True

Thanks,
Ofri

-- 
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/groups/opt_out.

Reply via email to