[Twisted-Python] Registering functions to be run at shutdown, delayeds
Itamar Shtull-Trauring
lists at itamarst.org
Sun Sep 23 02:44:56 MDT 2001
Right now, functions to be run at shutdown are added by appending to
twisted.internet.main.shutdowns, and delayeds are added by appending to
twisted.internet.main.delayeds. I suggest adding functions for both:
Index: main.py
===================================================================
RCS file: /cvs/Twisted/twisted/internet/main.py,v
retrieving revision 1.27
diff -c -r1.27 main.py
*** main.py 2001/09/19 12:18:09 1.27
--- main.py 2001/09/23 08:46:55
***************
*** 373,378 ****
--- 373,388 ----
callback()
except:
traceback.print_exc(file=log.logfile)
+
+ def addShutdown(function):
+ """Add a function to be called at shutdown.
+ """
+ shutdowns.append(function)
+
+ def addDelayed(delayed):
+ """Add a Delayed object to the event loop"""
+ delayeds.append(delayed)
+
def addReader(reader):
"""Add a FileDescriptor for notification of data available to read.
"""
More information about the Twisted-Python
mailing list