skip to navigation
skip to content

ndb-x 0.0.1

Synchronization primitives for ndb tasklets on Google App Engine (GAE)

Inspired by pythons new asyncio, this package implements the most basic synchronization primitives to work with ndb’s tasklets for the Google AppEngine (GAE)


pip install ndb-x


We have the three primitives Lock, Semaphore and BoundedSemaphore. Usage is, what you expect, straightforward:

from google.appengine.ext import ndb
from ndbx.locks import Lock

lock = Lock()

def work_async():
    # using a context-manager will release the lock automatically
    with (yield lock.acquire()):
        rv = yield do_something_async()

def traditional_flow():
    yield lock.acquire()
        # do something
File Type Py Version Uploaded on Size (md5) Source 2014-04-28 8KB