Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 258fabe

Browse files
committed
#11109: clean up docs, add whatsnew entry, and fix Justin's last name.
1 parent 7eb03dd commit 258fabe

4 files changed

Lines changed: 22 additions & 10 deletions

File tree

Doc/library/socketserver.rst

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,20 +153,22 @@ Server Objects
153153

154154
.. method:: BaseServer.serve_forever(poll_interval=0.5)
155155

156-
Handle requests until an explicit :meth:`shutdown` request.
157-
Poll for shutdown every *poll_interval* seconds. Ignores :attr:`self.timeout`. It also calls
158-
:meth:`service_actions` which may be used by a subclass or Mixin to provide
159-
various cleanup actions. For e.g. ForkingMixin class uses
160-
:meth:`service_actions` to cleanup the zombie child processes.
156+
Handle requests until an explicit :meth:`shutdown` request. Poll for
157+
shutdown every *poll_interval* seconds. Ignores :attr:`self.timeout`. It
158+
also calls :meth:`service_actions`, which may be used by a subclass or mixin
159+
to provide actions specific to a given service. For example, the
160+
:class:`ForkingMixIn` class uses :meth:`service_actions` to clean up zombie
161+
child processes.
161162

162163
.. versionchanged:: 3.3
163-
Added service_actions call to the serve_forever method.
164+
Added ``service_actions`` call to the ``serve_forever`` method.
164165

165166

166167
.. method:: BaseServer.service_actions()
167168

168-
This is called by the serve_forever loop. This method is can be overridden
169-
by Mixin's to add cleanup or service specific actions.
169+
This is called in the :meth:`serve_forever` loop. This method is can be
170+
overridden by subclasses or mixin classes to perform actions specific to
171+
a given service, such as cleanup actions.
170172

171173
.. versionadded:: 3.3
172174

Doc/whatsnew/3.3.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1805,6 +1805,16 @@ socket
18051805
(Contributed by Ross Lagerwall in :issue:`10866`.)
18061806

18071807

1808+
socketserver
1809+
------------
1810+
1811+
:class:`~socketserver.BaseServer` now has an overridable method
1812+
:meth:`~socketserver.BaseServer.service_actions` that is called by the
1813+
:meth:`~socketserver.BaseServer.serve_forever` method in the service loop.
1814+
:class:`~socketserver.ForkingMixIn` now uses this to clean up zombie
1815+
child proceses. (Contributed by Justin Warkentin in :issue:`11109`.)
1816+
1817+
18081818
sqlite3
18091819
-------
18101820

Lib/socketserver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ def handle_timeout(self):
562562
self.collect_children()
563563

564564
def service_actions(self):
565-
"""Collect the zombie child processes regularly in the ForkingMixin.
565+
"""Collect the zombie child processes regularly in the ForkingMixIn.
566566
567567
service_actions is called in the BaseServer's serve_forver loop.
568568
"""

Misc/NEWS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3296,7 +3296,7 @@ Library
32963296
if the file is closed.
32973297

32983298
- Issue #11109: New service_action method for BaseServer, used by ForkingMixin
3299-
class for cleanup. Initial Patch by Justin Wark.
3299+
class for cleanup. Initial Patch by Justin Warkentin.
33003300

33013301
- Issue #12045: Avoid duplicate execution of command in
33023302
ctypes.util._get_soname(). Patch by Sijin Joseph.

0 commit comments

Comments
 (0)