]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Merge pull request #3147 from bdarnell/docs62
authorBen Darnell <ben@bendarnell.com>
Fri, 3 Jun 2022 19:29:26 +0000 (15:29 -0400)
committerGitHub <noreply@github.com>
Fri, 3 Jun 2022 19:29:26 +0000 (15:29 -0400)
docs,demos: Update for asyncio.run pattern

1  2 
tornado/web.py

diff --cc tornado/web.py
index f3eb6e1e7bdf93d0151e3daca09e49059c3ee3f9,0604053ff4fd8628a8b75ddff135603dc242986c..cd6a81b4b50ed3f9d6c234234db542698dfa0ef3
@@@ -2095,25 -2095,14 +2097,24 @@@ class Application(ReversibleRouter)
  
              autoreload.start()
  
 -    def listen(self, port: int, address: str = "", **kwargs: Any) -> HTTPServer:
 +    def listen(
 +        self,
 +        port: int,
 +        address: Optional[str] = None,
 +        *,
 +        family: socket.AddressFamily = socket.AF_UNSPEC,
 +        backlog: int = tornado.netutil._DEFAULT_BACKLOG,
 +        flags: Optional[int] = None,
 +        reuse_port: bool = False,
 +        **kwargs: Any
 +    ) -> HTTPServer:
          """Starts an HTTP server for this application on the given port.
  
-         This is a convenience alias for creating an `.HTTPServer`
-         object and calling its listen method.  Keyword arguments not
-         supported by `HTTPServer.listen <.TCPServer.listen>` are passed to the
-         `.HTTPServer` constructor.  For advanced uses
-         (e.g. multi-process mode), do not use this method; create an
-         `.HTTPServer` and call its
+         This is a convenience alias for creating an `.HTTPServer` object and
+         calling its listen method.  Keyword arguments not supported by
+         `HTTPServer.listen <.TCPServer.listen>` are passed to the `.HTTPServer`
+         constructor.  For advanced uses (e.g. multi-process mode), do not use
+         this method; create an `.HTTPServer` and call its
          `.TCPServer.bind`/`.TCPServer.start` methods directly.
  
          Note that after calling this method you still need to call