On Thu, Sep 29, 2011 at 10:37 AM, Victor Hooi <[email protected]> wrote:
> However, what did you mean by it may be "nontrivial to use twisted with > non-twisted friendly libraries"? What would make a library non-Twisted > friendly? > Most important, I think, is for non-reactor code to not block. E.g. if you're using a library to read from a database, the database library code should release control between the time you make a request and the time the library delivers the results of that request. For example, a "nice" request call might have a callback argument and return immediately, triggering the callback when results are ready. Note that if you *must* use a library which is blocking, a possible solution is to execute the blocking code in a thread. But, this isn't easy to get right and the python GIL can cause problems if you need a lot of threads. Jason
_______________________________________________ Twisted-Python mailing list [email protected] http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
