擅长:python、mysql、java
<p>我四处搜索,找到了Python<a href="http://circuitsframework.com" rel="nofollow">circuits</a>框架,这使得等待成为可能
对于一个特定的事件。</p>
<p>电路的<code>.callEvent(self, event, *channels)</code>方法包含一个fire和suspend-until响应功能,文档中说:</p>
<blockquote>
<p>Fire the given event to the specified channels and suspend execution
until it has been dispatched. This method may only be invoked as
argument to a <code>yield</code> on the top execution level of a handler (e.g.
"<code>yield self.callEvent(event)</code>"). It effectively creates and returns
a generator that will be invoked by the main loop until the event has
been dispatched (see :func:<code>circuits.core.handlers.handler</code>).</p>
</blockquote>
<p>我希望你和我一样觉得它有用:)<br/>
/问候</p>