s.database : module documentation

Part of sasync Source for database.py Main doc for sAsync

Asynchronous database transactions via SQLAlchemy and Twisted. You will surely have a subclass of AccessBroker.

Function transaction Everything making up a transaction, and everything run in the thread, is contained within this little function, including of course a call to func.
Function nextFromRP Transaction magic.
Function isNested Transaction magic.
Function transact Transaction decorator.
Class AccessBroker I manage asynchronous access to a database.
def transaction(self, func, *t_args, **t_kw):

Everything making up a transaction, and everything run in the thread, is contained within this little function, including of course a call to func.

def nextFromRP(rp, N=1):

Transaction magic.

def isNested(self):

Transaction magic.

def transact(f):

Transaction decorator.

Use this function as a decorator to wrap the supplied method f of AccessBroker in a transaction that runs f(*args, **kw) in its own transaction.

Immediately returns a Deferred that will eventually have its callback called with the result of the transaction. Inspired by and largely copied from Valentino Volonghi's makeTransactWith code.

You can add the following keyword options to your function call:

Parameters niceness Scheduling niceness, an integer between -20 and 20, with lower numbers having higher scheduling priority as in UNIX nice and renice.
doNext Set True to assign highest possible priority, even higher than with niceness = -20.
doLast Set True to assign lower possible priority, even lower than with niceness = 20.
consumer Set this to a consumer object (must implement the twisted.interfaces.IConsumer interface) and the SA.ResultProxy will write its rows to it in Twisted fashion. The returned Deferred will fire when all rows have been written.
raw Set True to have the transaction result returned in its original form even if it's a RowProxy or other iterator.
API Documentation for sAsync, generated by pydoctor at 2016-11-16 14:52:15.