bpo-31639: Use threads in http.server module. (GH-5018)

This commit is contained in:
Julien Palard 2018-03-23 17:40:33 +01:00 committed by GitHub
parent a0a42d22d8
commit 8bcfa02e4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 4 deletions

View file

@ -33,9 +33,16 @@ handler. Code to create and run the server looks like this::
:attr:`server_port`. The server is accessible by the handler, typically
through the handler's :attr:`server` instance variable.
.. class:: ThreadedHTTPServer(server_address, RequestHandlerClass)
The :class:`HTTPServer` must be given a *RequestHandlerClass* on instantiation,
of which this module provides three different variants:
This class is identical to HTTPServer but uses threads to handle
requests by using the :class:`~socketserver.ThreadingMixin`. This
is usefull to handle web browsers pre-opening sockets, on which
:class:`HTTPServer` would wait indefinitly.
The :class:`HTTPServer` and :class:`ThreadedHTTPServer` must be given
a *RequestHandlerClass* on instantiation, of which this module
provides three different variants:
.. class:: BaseHTTPRequestHandler(request, client_address, server)