コード例 #1
0
ファイル: test_misc.py プロジェクト: Primevenn/python-ndb
    def update(id, add, delay=0):
        entity = yield SomeKind.get_by_id_async(id)
        foo = entity.foo
        foo += add

        yield ndb.sleep(delay)
        entity.foo = foo

        yield entity.put_async()
コード例 #2
0
 def callback():
     transaction = ndb.get_context().transaction
     yield ndb.sleep(delay)
     assert ndb.get_context().transaction == transaction
     raise ndb.Return(transaction)