I read your post again, and it looks as though you might want to use the
atexit module. Another idea would be to trap the SIGTERM signal and to keep
a registry of instances, and then to invoke a cleanup method of each
instance.
Another important note: trapping signals will have no effect if yo
SIGKILL is not trappable. You probably want SIGTERM. Furthermore, this
signal will be sent to the process, not some thread or class instance within
a process.
Maybe you need some other mechanism? Is the signal going to be from the same
python process? If so, just call it directly. Otherwis
Hi all,
I have a series of class instances saved in an array. I need the
instances to respond to a SIGKILL by writing to a file and
sys.exit()-ing.
Am I right in codeing it as below ? ... does the sys.exit() kill the
instance or the instance & the instance holding array definition above
it ?
Che