This reminded me of something I read years ago from Doug Schmidt on a pattern half sync half async: 

http://www.cs.wustl.edu/~schmidt/PDF/PLoP-95.pdf

I feel it is relevant but the picture may be upside down in relation to writing twisted wrappers which may want to wrap a blocking API.


On Aug 21, 2013, at 11:05 AM, Jonathan Vanasco <twisted-python@2xlp.com> wrote:

Having a great ORM for twisted is wonderful , but its way less exciting and attractive if it's only for twisted.

Doing this is simple, although probably not easy: you just need to convince the SQLAlchemy folks to separate the process of generating SQL and executing SQL, and expose hooks for event-driven frameworks (which is an ever-expanding circle now, encompassing Twisted, Tornado, Pulsar, and Tulip) to schedule SQL execution with an event-driven backend rather than assuming it can block.

When I faced this problem, I wanted to use SQLAlchemy rather than write my own ORM, but I was unable to due the lack of a public API for generating cross-database SQL.

-glyph