[Twisted-Python] Blocking on deferreds during unit tests (e.g. deferredResult)

Kevin Dangoor dangoor at gmail.com
Sat May 7 11:02:09 EDT 2005


On 5/6/05, Christopher Armstrong <radeex at gmail.com> wrote:
> I'd suggest 1) not writing a unit test framework, and instead using
> trial, and 2) instead of using stackless, use greenlet + my
> gthreadless module that integrates greenlets and Deferreds
> (sandbox/radix/gthreadless.py).

gthreadless looks quite cool! From things I've seen along the way, it
seems that many people are turned off by the callback style of
programming required by an async framework like Twisted. Using
gthreadless, your code looks just like normal synchronous code.

I'm only a little familiar with greenlet. Is there any significant
disadvantage to using this approach extensively? For example, is the
overhead very large?

Using gthreadless, one could interface sqlobject and Twisted's db
interface to take advantage of the work done in Twisted Enterprise to
make sqlobject-style database access safe for Twisted. (It's
undoubtedly possible without gthreadless, but it seems like it would
be a lot easier)

Kevin




More information about the Twisted-Python mailing list