How to get the reactor from ApplicationRunner in autobahnPython
<p>I have an autobahn client using the ApplicationRunner class from autobahn  to connect to a WAMP router (crossbar). In the main section it attaches my ApplicationSession class "REScheduler" like this:</p>

<pre><code>if __name__ == '__main__':
    from autobahn.twisted.wamp import ApplicationRunner

    runner = ApplicationRunner(url=u"ws://localhost:8080/ws", realm=u"RE_acct")

    runner.run(REScheduler, start_reactor=True, auto_reconnect=True)
</code></pre>

<p>Now I need the reactor that the application runner started for other purposes as well. Like e.g. to call some <code>reactor.callLater(...)</code>.
How can I access this reactor. I did not find anything in the docs.</p>

<p>Twisted (sadly) uses a (process) global reactor object. That means, once a reactor is chosen (which <code>ApplicationRunner</code> does if you set <code>start_reactor=True</code>), simply do a <code>from twisted.internet import reactor</code> at <strong>the place within your code</strong> where you need it.</p>

<p>asyncio has properly encapsulated the event loop (you can have multiple event loops in a single process).</p>

<blockquote>
  <p>txaio provides a convenience method that will work on both (it will expose the single, global reactor in Twisted, and it will expose the event loop under which ApplicationRunner is started): <code>txaio.config.loop = reactor</code></p>
</blockquote>

python twisted autobahn crossbar