[Twisted-Python] One big smile ...
abe at fettig.net
Mon Jul 14 22:33:44 EDT 2003
On Sat, 2003-07-12 at 19:05, Moshe Zadka wrote:
> Note that your service has a bug if .startService() is called
> twice without an intervening stopService(), and you present
> here for users an ability to tickle that bug. You can probably
> work around in many ways...
> ...but I prefer to having non-parents .enable() or .disable()
> the service. Of course, it can start enabled by default, but
> this way you have a clear distinction which methods are supposed
> to be called by whom.
Hmm, I guess I don't quite understand this. Why should it matter if a
services is being started by the parent or not? Is there a chance the
parent could think the service was still running when it really wasn't?
This is an important point to me as I like the idea of letting
administrators turn services on and off without stopping the
> If you call it "application" insteadof "myApp", the next line
> is not needed: instead of "Python"ing it, "twistd -y" it
> [or maybe twistd -ny if you don't want forking]
If I do this, I get an error on shutdown, as it tries to create a
snapshot of the running app:
2003/07/14 22:22 EDT [*Test App*] Saving Test App application to Test
2003/07/14 22:22 EDT [*Test App*] Traceback (most recent call last):
"/usr/lib/python2.2/site-packages/twisted/python/context.py", line 32,
122, in run
130, in mainLoop
"/usr/lib/python2.2/site-packages/twisted/internet/base.py", line 368,
--- <exception caught here> ---
"/usr/lib/python2.2/site-packages/twisted/internet/base.py", line 289,
"/usr/lib/python2.2/site-packages/twisted/internet/app.py", line 784, in
"/usr/lib/python2.2/site-packages/twisted/internet/app.py", line 745, in
"/usr/lib/python2.2/site-packages/twisted/internet/app.py", line 727, in
_dump(obj, file, 1)
cPickle.PicklingError: Can't pickle
__builtin__.ServiceWebManager: it's not found as
Do you know how to fix this?
More information about the Twisted-Python