[Stackless] Res: stackless & wxpython in one app?
Esteban U. Caamano Castro
euccastro at yahoo.com
Wed Jan 7 18:38:28 CET 2009
Redundant, please ignore. I failed to notice the digest where this was replied.
----- Mensagem original ----
De: Esteban U. Caamano Castro <euccastro at yahoo.com>
Para: stackless at stackless.com
Enviadas: Quarta-feira, 7 de Janeiro de 2009 18:33:20
Assunto: Re: stackless & wxpython in one app?
>> "Integration of Stackless with wxPython. This can be done very simply;
>> the python script launches stackless.run(), and the main tasklet runs
>> the wxPython event loop."
> I have tried that but found that my stackless threadlets are not fired.
You need to yield regularly to give them a chance. Have you tried calling stackless.schedule() on the idle event handler for your main window?
> On my server I had ended up putting a while 1: around stackless.run() to
> ensure that stackless keeps on running for me.
I don't know why you'd need to do that, at least if the main server loop (the one that accepts connections) is in a tasklet.
> This is of course incompatible with starting the wxpython main loop.
The call to start the main loop only returns when your application exits. If that's in a tasklet, you should never have to worry about stackless.run() ending while your app is running?
More information about the Stackless