Hi,

        I was wondering what's the recommended way to initialize a "complex" 
twisted application. Typically, let's say I have an application which 
needs to create a couple of "heavy" objects, each of which may create 
mysql db/tables:

class MyApplication(object):
     def __init__(self):
         # object1 and object2 may need to interact with MySQL,
         # and object2 assumes that object1 is completely initialized
         object1 = SomeClass1()
         object2 = SomeClass2()

Writing this kind of code asynchronously seems very tedious. My current 
solution is to use non-twisted, blocking API, but there may be a more 
elegant solution ? My main issue with using blocking API is that I 
sometimes have to write the same kind of code twice (one blocking, one 
non blocking).

cheers,

David

_______________________________________________
Twisted-Python mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to