[Twisted-Python] spawnProcess and when to kill
![](https://secure.gravatar.com/avatar/68a3e534292b681267cc280088f42c18.jpg?s=120&d=mm&r=g)
hi, all I start a process using spawnProcess and want to kill when my certain Factory stops. something I wrote like these ---------- p = SomeProtocol(ProcessProtocol) reactor.spawnProcess(p, 'twistd', ['twistd', '-y', 'anotherMain.py'], {}) ---------- class Factory(ServerFactory): ... def StopFactory(self): # which is the p above p.transport.signalProcess("KILL") I thought the subprocess will be killed which is not. What's wrong with my code? Thanks! Regards, Huang 黄 轶明 mail: hoooooosety@gmail.com phone: 18620129285
![](https://secure.gravatar.com/avatar/de9f07c5d168b7b02dadf4bb7700941b.jpg?s=120&d=mm&r=g)
On Tue, Nov 27, 2012 at 8:59 AM, 黄 轶明 <hoooooosety@gmail.com> wrote:
Perhaps StopFactory is not being called? Are you calling it? If not, and you expected the reactor to call it when you stopped listening, it should be stopFactory, rather than StopFactory. -- Itamar Turner-Trauring, Future Foundries LLC http://futurefoundries.com/ — Twisted consulting, training and support.
![](https://secure.gravatar.com/avatar/de9f07c5d168b7b02dadf4bb7700941b.jpg?s=120&d=mm&r=g)
On Tue, Nov 27, 2012 at 8:59 AM, 黄 轶明 <hoooooosety@gmail.com> wrote:
Perhaps StopFactory is not being called? Are you calling it? If not, and you expected the reactor to call it when you stopped listening, it should be stopFactory, rather than StopFactory. -- Itamar Turner-Trauring, Future Foundries LLC http://futurefoundries.com/ — Twisted consulting, training and support.
participants (3)
-
exarkun@twistedmatrix.com
-
Itamar Turner-Trauring
-
黄 轶明