This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Use context manager protocol for more multiprocessing types
Type: enhancement Stage: resolved
Components: Versions: Python 3.3
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: dan.oreilly, ned.deily, python-dev, sbt, tshepang
Priority: normal Keywords:

Created on 2012-06-14 12:13 by sbt, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (5)
msg162776 - (view) Author: Richard Oudkerk (sbt) * (Python committer) Date: 2012-06-14 12:13
There are some types which should support the context manager protocol:

- connection objects
- listener objects
- pool objects
msg163107 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-06-18 16:55
New changeset 6d2a773d8e00 by Richard Oudkerk in branch 'default':
Issue #15064: Implement context manager protocol for multiprocessing types
msg163119 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-06-18 20:31
New changeset 198382b4bcd0 by Richard Oudkerk in branch 'default':
Issue #15064: Make BaseManager.__enter__() start server if necessary.

New changeset 836d712461b3 by Richard Oudkerk in branch 'default':
Issue #15064: Use with-blocks for some examples in docs.
msg242120 - (view) Author: Dan O'Reilly (dan.oreilly) * Date: 2015-04-27 15:07
It's probably too late to do anything about this now, but wouldn't it make more sense for `Pool.__exit__` to call `close`, rather than `terminate`? The vast majority of the time, that's probably what the user of the `Pool` would want to run. It also would make the behavior consistent with `concurrent.futures.ProcessPoolExecutor`, which will always wait for pending tasks to complete before exiting the `with` block.
msg242162 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2015-04-28 01:38
Dan, this issue was closed and the code associated with it released a few years ago.  Comments here will likely be ignored.  If you want to pursue your suggestion, please open a new issue for it.
Date User Action Args
2022-04-11 14:57:31adminsetgithub: 59269
2020-10-20 19:44:15iritkatriellinkissue23510 superseder
2015-04-28 01:38:05ned.deilysetnosy: + ned.deily
messages: + msg242162
2015-04-27 15:07:10dan.oreillysetnosy: + dan.oreilly
messages: + msg242120
2012-06-19 13:20:14sbtsetstatus: open -> closed
title: multiprocessing should use more context manager -> Use context manager protocol for more multiprocessing types
resolution: fixed
stage: needs patch -> resolved
2012-06-18 20:31:54python-devsetmessages: + msg163119
2012-06-18 16:55:39python-devsetnosy: + python-dev
messages: + msg163107
2012-06-15 16:27:03tshepangsetnosy: + tshepang
2012-06-14 12:13:45sbtcreate