[Twisted-Python] Handling application initialization synchronously

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

On Mon, 2011-06-20 at 16:00 +0900, David wrote:
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:
You could create all of the objects you need in one runInteraction call, maybe?
participants (2)
-
David
-
Itamar Turner-Trauring