class SlowHandler(BaseHTTPRequestHandler):

    def do_GET(self):
        self.send_response(200)
self.send_header('Content-type', 'text/plain')
self.end_headers()
self.wfile.write('Entered GET request handler')
time.sleep(1)
self.wfile.write('Sending response!')

def test(HandlerClass=SlowHandler, ServerClass=ThreadedHTTPServer):
    _test(HandlerClass, ServerClass)
if __name__ == '__main__':
    test()
Обработка одновременных/асинхронных запросов с помощью Python BaseHTTPServer