I have a query handler that updates the object, saves it in the data warehouse, then it needs to do some additional work before returning (for example, to sequence the background task and json serialize some results). I want to parallelize this code so that extra work is done while the object is being saved.
Here the code of my handler comes down to:
class FooHandler(webapp2.RequestHandler):
@ndb.toplevel
def post(self):
foo = yield Foo.get_by_id_async(some_id)
foo.put_async()
taskqueue.add(...)
json_result = generate_result()
self.response.headers["Content-Type"] = "application/json; charset=UTF-8"
self.response.write(json_result)
However, Appstats shows that RPC datastore.Putis executed in series, after taskqueue.Add:

A little digging through ndb.context.pyshows that the call put_async()ends with adding to AutoBatcherinstead of RPC, which is issued immediately.
, , _put_batcher , toplevel .
, puts , , RPC- , , .
yield foo.put_async(), Appstats, datastore.Put :

, yield put_async() .
ndb.get_context().flush() foo.put_async(), datastore.Put taskqueue.BulkAdd - Appstats.
, : put_async() RPC?