title: How to pass Queue to baseHTTPServer
body: <p>I'm using the example bellow with Thread, a simple http server to listen to post request and collect the data for the main process.
  I want to convert it to use multiprocessing and passing a Queue in order to collect the POST data but I'm not sure how to pass it, any idea on how to do so?</p>
  
  <pre><code>from threading import Thread
  from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
  from io import BytesIO
  
  KEEP_RUNNING = True
  COLLECT_POST_DATA = []
  
  class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
  
      def do_POST(self):
          content_length = int(self.headers['Content-Length'])
          body = self.rfile.read(content_length)
          print("body: {}".format(body))
          COLLECT_POST_DATA.append(body)
          self.send_response(200)
          self.end_headers()
          response = BytesIO()
          response.write(b'This is POST request. ')
          response.write(b'Received: ')
          response.write(body)
          self.wfile.write(response.getvalue())
  
  def run_server(port):
      httpd = HTTPServer(('0.0.0.0', port), SimpleHTTPRequestHandler)
      httpd.timeout = 1
      while KEEP_RUNNING:
          httpd.handle_request()
      # httpd.serve_forever()
  
  t = Thread(target = run_server, args=(8000,))
  t.start()
  
  # to kill
  KEEP_RUNNING = False
  </code></pre>