summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/__init__.py
Commit message (Collapse)AuthorAgeFilesLines
* gh-106075: add `asyncio.taskgroups.__all__` to `asyncio.__all__` (#106090)James Webber2023-06-261-0/+1
| | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* bpo-46771: Implement asyncio context managers for handling timeouts (GH-31394)Andrew Svetlov2022-03-101-0/+2
| | | | | | | | | | Example: async with asyncio.timeout(5): await some_task() Will interrupt the await and raise TimeoutError if some_task() takes longer than 5 seconds. Co-authored-by: Guido van Rossum <guido@python.org>
* bpo-46752: Add TaskGroup; add Task..cancelled(),.uncancel() (GH-31270)Guido van Rossum2022-02-151-0/+1
| | | | | | | | | | | | | | | | | asyncio/taskgroups.py is an adaptation of taskgroup.py from EdgeDb, with the following key changes: - Allow creating new tasks as long as the last task hasn't finished - Raise [Base]ExceptionGroup (directly) rather than TaskGroupError deriving from MultiError - Instead of monkey-patching the parent task's cancel() method, add a new public API to Task The Task class has a new internal flag, `_cancel_requested`, which is set when `.cancel()` is called successfully. The `.cancelling()` method returns the value of this flag. Further `.cancel()` calls while this flag is set return False. To reset this flag, call `.uncancel()`. Thus, a Task that catches and ignores `CancelledError` should call `.uncancel()` if it wants to be cancellable again; until it does so, it is deemed to be busy with uninterruptible cleanup. This new Task API helps solve the problem where TaskGroup needs to distinguish between whether the parent task being cancelled "from the outside" vs. "from inside". Co-authored-by: Yury Selivanov <yury@edgedb.com> Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-42582: Remove asyncio._all_tasks_compat(). (GH-23664)Serhiy Storchaka2020-12-061-4/+0
| | | It was used to implement now removed asyncio.Task.all_tasks().
* bpo-32309: Implement asyncio.to_thread() (GH-20143)Kyle Stanley2020-05-191-0/+2
| | | | | Implements `asyncio.to_thread`, a coroutine for asynchronously running IO-bound functions in a separate thread without blocking the event loop. See the discussion starting from [here](https://github.com/python/cpython/pull/18410#issuecomment-628930973) in GH-18410 for context. Automerge-Triggered-By: @aeros
* bpo-38242: Revert "bpo-36889: Merge asyncio streams (GH-13251)" (#16482)Yury Selivanov2019-09-301-38/+0
| | | See https://bugs.python.org/issue38242 for more details
* bpo-36889: Merge asyncio streams (GH-13251)Andrew Svetlov2019-05-271-0/+38
| | | https://bugs.python.org/issue36889
* bpo-34622: Extract asyncio exceptions into a separate module (GH-9141)Andrew Svetlov2018-09-111-0/+2
|
* bpo-32610: Fix asyncio.all_tasks() to return only pending tasks. (GH-7174)Yury Selivanov2018-05-281-0/+4
|
* bpo-32314: Implement asyncio.run() (#4852)Yury Selivanov2017-12-141-0/+2
|
* bpo-32262: Fix codestyle; use f-strings formatting where necessary. (#4775)Yury Selivanov2017-12-101-0/+2
|
* bpo-32154: Remove asyncio.selectors (#4605)Victor Stinner2017-11-281-15/+0
| | | | | | | | | | | | * Remove asyncio.selectors and asyncio._overlapped symbols from the namespace of the asyncio module * Replace "from asyncio import selectors" with "import selectors" * Replace "from asyncio import _overlapped" with "import _overlapped" asyncio.selectors was added to support Python 3.3, which doesn't have selectors in its standard library, and Python 3.4 in the same code base. Same rationale for asyncio._overlapped. Python 3.3 reached its end of life, and asyncio is no more maintained as a third party module on PyPI.
* Issue #23046: Expose the BaseEventLoop class in the asyncio namespaceVictor Stinner2015-01-061-1/+3
|
* Fix asyncio.__all__: export also unix_events and windows_events symbolsVictor Stinner2014-07-181-6/+7
| | | | | For example, on Windows, it was not possible to get ProactorEventLoop or DefaultEventLoopPolicy using "from asyncio import *".
* asyncio: sync with Tulip, add a new asyncio.coroutines moduleVictor Stinner2014-06-281-1/+3
|
* Issue #20400: Merge Tulip into Python: add the new asyncio.subprocess moduleVictor Stinner2014-02-011-0/+2
| | | | | | | | | | | | | | | | | | | | * Add a new asyncio.subprocess module * Add new create_subprocess_exec() and create_subprocess_shell() functions * The new asyncio.subprocess.SubprocessStreamProtocol creates stream readers for stdout and stderr and a stream writer for stdin. * The new asyncio.subprocess.Process class offers an API close to the subprocess.Popen class: - pid, returncode, stdin, stdout and stderr attributes - communicate(), wait(), send_signal(), terminate() and kill() methods * Remove STDIN (0), STDOUT (1) and STDERR (2) constants from base_subprocess and unix_events, to not be confused with the symbols with the same name of subprocess and asyncio.subprocess modules * _ProactorBasePipeTransport.get_write_buffer_size() now counts also the size of the pending write * _ProactorBaseWritePipeTransport._loop_writing() may now pause the protocol if the write buffer size is greater than the high water mark (64 KB by default)
* asyncio: Don't export BaseEventLoop, BaseSelectorEventLoop norVictor Stinner2014-01-251-7/+1
| | | | | | BaseProactorEventLoop Import them from submodules if you really need them.
* Update asyncio from the Tulip projectVictor Stinner2014-01-251-5/+13
| | | | | | | | | | | | | | | | Major changes: - StreamReader.readexactly() now raises an IncompleteReadError if the end of stream is reached before we received enough bytes, instead of returning less bytes than requested. - Unit tests use the main asyncio module instead of submodules like events - _UnixWritePipeTransport now also supports character devices, as _UnixReadPipeTransport. Patch written by Jonathan Slenders. - Export more symbols: BaseEventLoop, BaseProactorEventLoop, BaseSelectorEventLoop, Queue and Queue sublasses, Empty, Full
* asyncio: Add support for running subprocesses on Windows with the IOCP event ↵Guido van Rossum2013-10-301-2/+10
| | | | loop (Richard Oudkerk).
* Initial checkin of asyncio package (== Tulip, == PEP 3156).Guido van Rossum2013-10-171-0/+33