TracNav menu
sAsync: SQLAlchemy done Asynchronously
sAsync offers asynchronous access to the outstanding SQLAlchemy package by Michael Bayer. It is built around an "access broker" object that provides a priority-queued asynchronous interface to database accesses. By wrapping your database-access methods in a @transact decorator, you can put the underlying method call in a queue with whatever scheduling priority you designate and immediately obtain a Deferred object that references the eventual result of the database transaction. The access broker also includes structure for convenient and integrated table setup, startup, and shutdown.
The package also provides higher-level SQLAlchemy enhancements including persistent item storage with deferred read and write results, and a persistent dictionary-like object using that storage. Text indexing and searching, again with deferred "behind the scenes" processing, will be included at some point.
Check out the usage page, some examples, and the API docs to see how you can put sAsync to work in your Twisted event loop. You'll see how everything is run in an asynchronous fashion using the Twisted framework and its deferred processing capabilities.
