There is an external function (another module) that uses Twisted, so in order for it to work I need to call reactor.run() However I want to call that function multiple times. How can I do it? (I get ReactorNotRestartable error)
run reactor in a loop (python twisted)
564 Views Asked by obar At
2
If there's an API you want to call and the implementation of that API calls
reactor.run
then you cannot call it more than once.Perhaps there is an alternate API you can call which does everything except for calling
reactor.run
. Then you can manage thereactor.run
call in your own code (making sure to only call it once) while calling that alternate API as many times as you like.