title: Python xmpp jabber client in tornado web application
body: <p>I am desktop programmer but I want to learn something about web services. I decided for python. I am trying understand how web applications works. I know how to create basic tornado website (request - response) and working jabber client, but I don't know how to mix them. Can I use any python components in web services? Does they must have specific structure ( sync or async )? Because I'm stuck in loop handlers:</p>
  
  <p>If tornado start web serwer by command:</p>
  
  <pre><code>app = Application()
  app.listen(options.port)
  tornado.ioloop.IOLoop.instance().start()
  </code></pre>
  
  <p>... so how (where) can I start xmpp loop?</p>
  
  <pre><code>client.connect()
  client.run()
  </code></pre>
  
  <p>I think that tornado listen loop should handle xmpp listening, but don't know how</p>
  
  <p>Regards.</p>
  
  <p><strong>Edit:</strong> I forgot. I am using pyxmpp2</p>