[Twisted-Python] LineReceiver Protocol
Jp Calderone
exarkun at divmod.com
Sun Nov 21 21:45:58 MST 2004
On Sun, 21 Nov 2004 17:48:15 -0800, Michael Mata <michael.mata at gaigen.net> wrote:
>Michael Mata wrote:
>
> > I tried placing the task in the factory's __init__ function, but it
> > doesn't seem to run.
>
> My mistake. The task does run when placed in the factory's __init__
> function.
>
Factory.startFactory() is a better place for it (and stopping the loop in Factory.stopFactory() is appropriate as well).
__init__ is called when the Application is instantiated. start* is called when the application is run. stop* is called when the application is stopped.
With a tac file, instantiation occurs at almost exactly when run does. With other forms of application configuration, this may not be true.
Jp
More information about the Twisted-Python
mailing list