Query regarding reactor.doSelect() and reactor.runUntilCurrent
<p>I am working on a game prototype using python twisted. Referring one of the books, I am currently using the following code to update the games </p>

<pre><code>def iterate(self):
    now = time.time()
    interval = now - self.beginFrame
    self.beginFrame = now

    # update the network
    reactor.runUntilCurrent()        
    reactor.doSelect(0)

    # update the games
    for game in self.games:
        game.update(interval) 
</code></pre>

<p>However, the above code fails in ubuntu machine with error "AttributeError: 'EPollReactor' object has no attribute 'doSelect'" . I am using twisted 16.1.1 and following are my questions </p>

<p>1) I didn't find runUntilCurrent and doSelect methods in the documentation given in twistedmatrix, are these methods not available anymore?</p>

<p>2) Is reactor.iterate() replacement of doSelect() ?
3) From earlier posts I found that reactor.iterate() may make the application slow and buggy. What is the best way to handle situations where one requires fact UI updates?</p>

<p>Twisted usually selects the epoll reactor by default. The <a href="https://twistedmatrix.com/documents/current/api/twisted.internet.selectreactor.SelectReactor.html#doSelect" rel="nofollow"><code>doSelect</code></a> function is available in the the <a href="https://twistedmatrix.com/documents/current/api/twisted.internet.selectreactor.html" rel="nofollow"><code>selectreactor</code></a>. To use the select reactor, first install the select reactor then import <code>twisted.internet.reactor</code>.</p>

<pre><code>from twisted.internet import selectreactor
selectreactor.install()
from twisted.internet import reactor
</code></pre>

<p>Select should work on most relevant operating systems which may be why your book uses it.</p>

<blockquote>
  <p>1) I didn't find runUntilCurrent and doSelect methods in the documentation given in twistedmatrix</p>
</blockquote>

<p>You're not looking hard enough mate :D try searching through all the <a href="https://twistedmatrix.com/documents/current/api/moduleIndex.html" rel="nofollow">modules and class documents</a> next time.</p>

<blockquote>
  <p>2) Is <code>reactor.iterate()</code> replacement of <code>doSelect()</code>.</p>
</blockquote>

<p>They both seem to do something similar, but I don't think they're intended to be replacements. Hopefully a Twisted core developer will see this question and correct me if I'm wrong.</p>

python twisted