title: python; asyncore handle_read; do I need a seperate thread?
body: <p>From asyncore's documentation: <a href="https://docs.python.org/2/library/asyncore.html" rel="nofollow">https://docs.python.org/2/library/asyncore.html</a></p>
  
  <pre><code>import asyncore, socket
  
  class HTTPClient(asyncore.dispatcher):
  
    def __init__(self, host, path):
        asyncore.dispatcher.__init__(self)
        self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
        self.connect( (host, 80) )
        self.buffer = 'GET %s HTTP/1.0\r\n\r\n' % path
  
    def handle_connect(self):
        pass
  
    def handle_close(self):
        self.close()
  
    def handle_read(self):
        print self.recv(8192)
  
    def writable(self):
        return (len(self.buffer) &gt; 0)
  
    def handle_write(self):
        sent = self.send(self.buffer)
        self.buffer = self.buffer[sent:]
  
    client = HTTPClient('www.python.org', '/')
    asyncore.loop()
  </code></pre>
  
  <p>Now suppose instead we have:</p>
  
  <pre><code>def handle_read(self):
      data = self.recv(8192)
      //SOME REALLY LONG AND COMPLICATED THING
  </code></pre>
  
  <p>Is this handled in Asyncore itself due to asyncore's polling/select methodlogy, or do I need to do:</p>
  
  <pre><code>def handle_read(self):
      data = self.recv(8192)
      h = Handler(data)
      h.start()
  
  class Handler(threading.Thread):
      def __init__(self, data):
          threading.Thread.__init__(self)
          self.data = data
      def run():
          //LONG AND COMPLICATED THING WITH DATA
  </code></pre>
  
  <p>If I do need a thread, do I want <code>h.join()</code> after <code>start</code>? It seems to work, but since join blocks, I'm not exactly sure why. </p>