title: How does Python's Twisted Reactor work?
body: <p>Recently, I've been diving into the Twisted docs. From what I gathered, the basis of Twisted's functionality is the result of it's event loop called the "Reactor". The reactor listens for certain events and dispatches them to registered callback functions that have been designed to handle these events. In the book, there is some pseudo code describing what the Reactor does but I'm having trouble understanding it, it just doesn't make any sense to me.  </p>
  
  <pre><code> while True:
       timeout = time_until_next_timed_event()
       events = wait_for_events(timeout)
       events += timed_events_until(now())
       for event in events:
           event.process()
  </code></pre>
  
  <p>What does this mean? </p>