[Twisted-Python] spawnProcess and when to kill
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
On 27 Nov, 01:59 pm, hoooooosety@gmail.com wrote:
hi, all
I start a process using spawnProcess and want to kill when my certain Factory stops.
something I wrote like these
Hi, Please don't double-post and please don't reply to another message when starting a new topic. Thanks. Jean-Paul
hi, JP I post the same question on stackoverflow, and my network has some problem yesterday, so I don't know if I send the email success or not. Please accept my pologize. 黄 轶明 mail: hoooooosety@gmail.com phone: 18620129285 在 2012-11-28,上午9:52,exarkun@twistedmatrix.com 写道:
On 27 Nov, 01:59 pm, hoooooosety@gmail.com wrote:
hi, all
I start a process using spawnProcess and want to kill when my certain Factory stops.
something I wrote like these
Hi,
Please don't double-post and please don't reply to another message when starting a new topic.
Thanks.
Jean-Paul
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
On Tue, Nov 27, 2012 at 8:59 AM, 黄 轶明 <hoooooosety@gmail.com> wrote:
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!
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
-
黄 轶明