擅长:python、mysql、java
<p>另一种方法是使用pub sub模块。</p>
<p>这意味着您有自己的连接subscribe</em>,而不是为每个连接设置超时,您只需在上述时间段后将一个超时设置为publish</em>。</p>
<p>可能实现得最多的是redis。也有一些模块专门针对龙卷风:例如<a href="https://github.com/mrjoes/toredis/blob/master/tests/test_handler.py" rel="nofollow">toredis</a>或<a href="https://github.com/evilkost/brukva" rel="nofollow">brükva</a>。</p>
<p>当然,这对于一个简单的页面来说可能不是必需的,但是它的伸缩性非常好,而且一旦您设置好它,就可以很好地进行维护/扩展。</p>