擅长:python、mysql、java
<pre><code>import eventlet
eventlet.monkey_patch()
</code></pre>
<p>不会神奇地把你的代码变成一个可以异步处理请求的多线程野兽(它仍然非常神奇和可怕)。</p>
<p>在<a href="http://eventlet.net/doc/examples.html#wsgi-server" rel="nofollow">this example</a>中可以看到,您需要使用<a href="http://eventlet.net/doc/modules/wsgi.html" rel="nofollow">eventlet wsgi's implementation</a>启动<code>wsgi</code>服务器。</p>
<p>如果你想要一个标准的解决方案,看看如何使用nginx和uwsgi来启动flask应用程序。您还可能对项目<a href="https://pypi.python.org/pypi/Spawning/" rel="nofollow">Spawning</a>感兴趣,该项目利用了创建一个完整的多线程wsgi处理程序的痛苦。</p>