O
Operation Latte Thunder
I have a simple ( I hope ) problem that I have been baning my head against
all day. I have isolated it down to a very small demo script, which I
will include below.
Basically, I want to have twisted run until an event makes it stop. My
problem is that my reactor.stop() doesn't seem to do anything if its not
called via a calllater or an equivilent. Unfortunately, my google-fu
seems weak today, as I have not been able to discern its solution.
Without further adieu:
from thread import start_new_thread
import time
from twisted.internet import reactor
def shutdown():
time.sleep( 1 )
print "Stopping"
reactor.stop()
start_new_thread ( shutdown, () )
reactor.run()
print "done"
This will continue to run even after printing "Stopping"
any ideas?
all day. I have isolated it down to a very small demo script, which I
will include below.
Basically, I want to have twisted run until an event makes it stop. My
problem is that my reactor.stop() doesn't seem to do anything if its not
called via a calllater or an equivilent. Unfortunately, my google-fu
seems weak today, as I have not been able to discern its solution.
Without further adieu:
from thread import start_new_thread
import time
from twisted.internet import reactor
def shutdown():
time.sleep( 1 )
print "Stopping"
reactor.stop()
start_new_thread ( shutdown, () )
reactor.run()
print "done"
This will continue to run even after printing "Stopping"
any ideas?