From: Ian B. <ia...@co...> - 2003-08-26 17:48:49
|
On Tuesday, August 26, 2003, at 12:00 PM, J-P Lee wrote: > Has anyone used SQLObject with woven+twisted? Do they work well > together? I'm currently using cherrypy and considering switching. > What do other people use? > I don't think SQLObject can work in Twisted. Twisted uses an async model, and SQLObject blocks all the time (like when transparently doing database queries), which would bring Twisted to a halt until the query is finished (which you might not even notice until you have concurrent requests). I suppose you could wrap every SQLObject attribute or method access in Twisted's threading stuff to avoid the blocking, but I don't know if SQLObject would feel very convenient after doing that. (I think the same blocking problem applies to CherryPy, but I believe there's also a way to configure it to use a thread for each request) Because of async, when you use Twisted you can't use most normal Python libraries. They are in a world of their own, at least if you want to use Twisted style. They do have an ORM of their own. I suppose you could use it if you moved to a different thread right away in your request, then you wouldn't have to guard every SQLObject attribute access. Ian |