Skip to content

Commit

Permalink
platform: Deprecate twisted and cares resolvers
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bdarnell authored and jeyrce committed Aug 25, 2021
1 parent 187e1a5 commit b7b6f2a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/caresresolver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
5 changes: 5 additions & 0 deletions docs/twisted.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.

4 changes: 4 additions & 0 deletions tornado/platform/caresresolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions tornado/platform/twisted.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit b7b6f2a

Please sign in to comment.