From 57cf319a71e95d9d3c521ee55c2d25d04a931f10 Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Sun, 1 Nov 2020 21:27:27 -0500 Subject: [PATCH] platform: Deprecate twisted and cares resolvers These were most interesting when the default resolver blocked the main thread. Now that the default is to use a thread pool, there is little if any demand for alternative resolvers just to avoid threads. --- docs/caresresolver.rst | 4 ++++ docs/twisted.rst | 5 +++++ tornado/platform/caresresolver.py | 4 ++++ tornado/platform/twisted.py | 4 ++++ 4 files changed, 17 insertions(+) diff --git a/docs/caresresolver.rst b/docs/caresresolver.rst index b5d6ddd10..4e0058eac 100644 --- a/docs/caresresolver.rst +++ b/docs/caresresolver.rst @@ -18,3 +18,7 @@ wrapper ``pycares``). so it is only recommended for use in ``AF_INET`` (i.e. IPv4). This is the default for ``tornado.simple_httpclient``, but other libraries may default to ``AF_UNSPEC``. + + .. deprecated:: 6.2 + This class is deprecated and will be removed in Tornado 7.0. Use the default + thread-based resolver instead. diff --git a/docs/twisted.rst b/docs/twisted.rst index f834eb55b..5d8fe8fbc 100644 --- a/docs/twisted.rst +++ b/docs/twisted.rst @@ -53,3 +53,8 @@ Twisted DNS resolver .. versionchanged:: 5.0 The ``io_loop`` argument (deprecated since version 4.1) has been removed. + + .. deprecated:: 6.2 + This class is deprecated and will be removed in Tornado 7.0. Use the default + thread-based resolver instead. + diff --git a/tornado/platform/caresresolver.py b/tornado/platform/caresresolver.py index e2c5009ac..962f84f48 100644 --- a/tornado/platform/caresresolver.py +++ b/tornado/platform/caresresolver.py @@ -26,6 +26,10 @@ class CaresResolver(Resolver): .. versionchanged:: 5.0 The ``io_loop`` argument (deprecated since version 4.1) has been removed. + + .. deprecated:: 6.2 + This class is deprecated and will be removed in Tornado 7.0. Use the default + thread-based resolver instead. """ def initialize(self) -> None: diff --git a/tornado/platform/twisted.py b/tornado/platform/twisted.py index 0987a84ab..153fe436e 100644 --- a/tornado/platform/twisted.py +++ b/tornado/platform/twisted.py @@ -52,6 +52,10 @@ class TwistedResolver(Resolver): .. versionchanged:: 5.0 The ``io_loop`` argument (deprecated since version 4.1) has been removed. + + .. deprecated:: 6.2 + This class is deprecated and will be removed in Tornado 7.0. Use the default + thread-based resolver instead. """ def initialize(self) -> None: -- 2.47.2