Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.6] bpo-31960: Fix asyncio.Future documentation for thread (un)safety. (GH-4319) #4320

Merged
merged 1 commit into from Nov 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Doc/library/asyncio-task.rst
Expand Up @@ -216,7 +216,7 @@ Future
raise an exception when the future isn't done yet.

- Callbacks registered with :meth:`add_done_callback` are always called
via the event loop's :meth:`~AbstractEventLoop.call_soon_threadsafe`.
via the event loop's :meth:`~AbstractEventLoop.call_soon`.

- This class is not compatible with the :func:`~concurrent.futures.wait` and
:func:`~concurrent.futures.as_completed` functions in the
Expand Down
4 changes: 3 additions & 1 deletion Lib/asyncio/futures.py
Expand Up @@ -112,11 +112,13 @@ class Future:

Differences:

- This class is not thread-safe.

- result() and exception() do not take a timeout argument and
raise an exception when the future isn't done yet.

- Callbacks registered with add_done_callback() are always called
via the event loop's call_soon_threadsafe().
via the event loop's call_soon().

- This class is not compatible with the wait() and as_completed()
methods in the concurrent.futures package.
Expand Down