[Twisted-Python] blocking code alongside with Twisted

Shuai Lin linshuai2012 at gmail.com
Fri Aug 31 23:30:35 MDT 2012


Hi all,

    My server mainly consists of two modules:
    -- http api handling (using twisted)
    -- backend blocking tasks

    The backend tasks have to block, because I have to call some
third-party API, which is always blocking. What's more, since the
third-party api call is blocking, I plan to use a thread pool to implement
a connection pool.

    My question is: Is it ok to use twisted in this manner?  i.e. I just
run `reactor.run()' in the main thread (to handle the http api request),
and the rest of the program is  blocking -- and intrinsically not related
to twisted.

    Any suggestion is appreciated. Thanks!

Lin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20120901/7603d29a/attachment-0001.html>


More information about the Twisted-Python mailing list