summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/events.py
Commit message (Collapse)AuthorAgeFilesLines
* gh-128340: add thread safe handle for `loop.call_soon_threadsafe` (#128369)Kumar Aditya2025-01-061-0/+28
| | | Adds `_ThreadSafeHandle` to be used for callbacks scheduled with `loop.call_soon_threadsafe`.
* gh-127949: deprecate `asyncio.set_event_loop` (#128218)Kumar Aditya2024-12-241-11/+21
| | | Deprecate `asyncio.set_event_loop` to be removed in Python 3.16.
* gh-127949: deprecate asyncio policy classes (#128216)Kumar Aditya2024-12-241-7/+7
|
* gh-127949: deprecate `asyncio.get_event_loop_policy` (#128053)Kumar Aditya2024-12-181-5/+9
| | | This deprecates `asyncio.get_event_loop_policy` and will be removed in Python 3.16.
* gh-127949: deprecate `asyncio.set_event_loop_policy` (#128024)Kumar Aditya2024-12-181-2/+8
| | | | First step towards deprecating the asyncio policy system. This deprecates `asyncio.set_event_loop_policy` and will be removed in Python 3.16.
* gh-126353: remove implicit creation of loop from `asyncio.get_event_loop` ↵Kumar Aditya2024-11-041-24/+0
| | | | | (#126354) Remove implicit creation of loop from `asyncio.get_event_loop`. This is a step forward of deprecating the policy system of asyncio.
* GH-120804: Remove `get_child_watcher` and `set_child_watcher` from asyncio ↵Kumar Aditya2024-06-231-23/+0
| | | | (#120818)
* gh-113538: Add asycio.Server.{close,abort}_clients (redo) (#116784)Pierre Ossman (ThinLinc team)2024-03-181-0/+8
| | | | | | | These give applications the option of more forcefully terminating client connections for asyncio servers. Useful when terminating a service and there is limited time to wait for clients to finish up their work. This is a do-over with a test fix for gh-114432, which was reverted.
* gh-113538: Revert "gh-113538: Add asycio.Server.{close,abort}_clients ↵Guido van Rossum2024-03-121-8/+0
| | | | | | | | | | (#114432)" (#116632) Revert "gh-113538: Add asycio.Server.{close,abort}_clients (#114432)" Reason: The new test doesn't always pass: https://github.com/python/cpython/pull/116423#issuecomment-1989425489 This reverts commit 1d0d49a7e86257ff95b4de0685e6997d7533993c.
* gh-113538: Add asycio.Server.{close,abort}_clients (#114432)Pierre Ossman (ThinLinc team)2024-03-111-0/+8
| | | | | | These give applications the option of more forcefully terminating client connections for asyncio servers. Useful when terminating a service and there is limited time to wait for clients to finish up their work.
* gh-112997: Don't log arguments in asyncio unless debugging (#115667)Pierre Ossman (ThinLinc team)2024-02-281-2/+4
| | | | | | Nothing else in Python generally logs the contents of variables, so this can be very unexpected for developers and could leak sensitive information in to terminals and log files.
* gh-95649: Document that asyncio contains uvloop code (#107536)Alois Klink2024-01-121-0/+4
| | | | | | | | Some of the asyncio SSL changes in GH-31275 [1] were taken from v0.16.0 of the uvloop project [2]. In order to comply with the MIT license, we need to just need to document the copyright information. [1]: https://github.com/python/cpython/pull/31275 [2]: https://github.com/MagicStack/uvloop/tree/v0.16.0
* gh-101336: Add keep_alive keyword arg for asyncio create_server() (#112485)beavailable2023-12-131-0/+4
|
* gh-106634: Corrected minor asyncio doc issues (#106671)Chris Brett2023-07-131-1/+1
|
* gh-100160: Restore and deprecate implicit creation of an event loop (GH-100410)Serhiy Storchaka2023-01-131-1/+23
| | | | | | | | | | Partially revert changes made in GH-93453. asyncio.DefaultEventLoopPolicy.get_event_loop() now emits a DeprecationWarning and creates and sets a new event loop instead of raising a RuntimeError if there is no current event loop set. Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
* GH-100363: Speed up `asyncio.get_running_loop` (#100364)Kumar Aditya2022-12-211-0/+1
|
* gh-93453: No longer create an event loop in get_event_loop() (#98440)Serhiy Storchaka2022-12-061-16/+2
| | | | | | | | | | | | | | | asyncio.get_event_loop() now always return either running event loop or the result of get_event_loop_policy().get_event_loop() call. The latter should now raise an RuntimeError if no current event loop was set instead of creating and setting a new event loop. It affects also a number of asyncio functions and constructors which call get_event_loop() implicitly: ensure_future(), shield(), gather(), etc. DeprecationWarning is no longer emitted if there is no running event loop but the current event loop was set. Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* GH-66285: fix forking in asyncio (#99769)Kumar Aditya2022-11-271-0/+11
| | | Closes #66285
* GH-66285: Revert "fix forking in asyncio" (#99756)Kumar Aditya2022-11-241-9/+0
|
* GH-66285: fix forking in `asyncio` (#99539)Kumar Aditya2022-11-241-0/+9
| | | `asyncio` now does not shares event loop and signal wakeupfd in forked processes.
* GH-96704: Add {Task,Handle}.get_context(), use it in ↵Guido van Rossum2022-10-051-0/+3
| | | | | call_exception_handler() (#96756) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* bpo-46994: Accept explicit contextvars.Context in asyncio create_task() API ↵Andrew Svetlov2022-03-141-1/+1
| | | | (GH-31837)
* bpo-46805: Add low level UDP socket functions to asyncio (GH-31455)Alex Grönholm2022-03-131-0/+9
|
* bpo-44011: New asyncio ssl implementation (#31275)Kumar Aditya2022-02-151-3/+16
| | | | | | | | | | | * bpo-44011: New asyncio ssl implementation Co-Authored-By: Andrew Svetlov <andrew.svetlov@gmail.com> * fix warning * fix typo Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-46278: fix typo introduced in GH-30427 (GH-30430)Kumar Aditya2022-01-061-2/+2
| | | Automerge-Triggered-By: GH:asvetlov
* Reflect 'context' arg in 'AbstractEventLoop.call_*()' methods (GH-30427)Andrew Svetlov2022-01-061-4/+4
|
* bpo-23819: asyncio: Replace AssertionError with TypeError where it makes ↵Kumar Aditya2021-12-061-3/+4
| | | | sense (GH-29894)
* Fix typos in the Lib directory (GH-28775)Christian Clauss2021-10-061-2/+2
| | | | | Fix typos in the Lib directory as identified by codespell. Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-44011: Revert "New asyncio ssl implementation (GH-17975)" (GH-25848)Pablo Galindo2021-05-031-16/+3
| | | | This reverts commit 5fb06edbbb769561e245d0fe13002bab50e2ae60 and all subsequent dependent commits.
* bpo-44011: New asyncio ssl implementation (#17975)Andrew Svetlov2021-05-021-3/+16
|
* bpo-39529: Deprecate creating new event loop in asyncio.get_event_loop() ↵Serhiy Storchaka2021-04-251-1/+10
| | | | | | (GH-23554) asyncio.get_event_loop() emits now a deprecation warning when it creates a new event loop. In future releases it will became an alias of asyncio.get_running_loop().
* bpo-41332: Added missing connect_accepted_socket() to AbstractEventLoop ↵Alex Grönholm2020-11-261-0/+14
| | | | | | (GH-21533) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com> Co-authored-by: Kyle Stanley <aeros167@gmail.com>
* bpo-40782: Change asyncio.AbstractEventLoop.run_in_executor to be a method ↵James Weaver2020-08-171-1/+1
| | | | | | not a coroutine (GH-21852) asyncio.AbstractEventLoop.run_in_executor should be a method that returns an asyncio Future, not an async method. This matches the concrete implementations, and the documentation better.
* bpo-40443: Remove unused imports in the stdlib (GH-19803)Victor Stinner2020-04-301-1/+0
|
* Fix typo from Lib/asyncio/events.py (GH-19410)Galden2020-04-141-1/+1
|
* bpo-38951: Use threading.main_thread() check in asyncio (GH-17433)Hill Ma2019-12-051-1/+1
| | | https://bugs.python.org/issue38951
* bpo-34344 Fix AbstractEventLoopPolicy.get_event_loop docstring (GH-16463)idomic2019-10-031-2/+2
|
* bpo-34037: Fix test_asyncio failure and add loop.shutdown_default_executor() ↵Kyle Stanley2019-09-191-0/+4
| | | | (GH-15735)
* bpo-37685: Fixed __eq__, __lt__ etc implementations in some classes. (GH-14952)Serhiy Storchaka2019-08-081-12/+12
| | | | They now return NotImplemented for unsupported type of the other operand.
* bpo-32528: Make asyncio.CancelledError a BaseException. (GH-13528)Yury Selivanov2019-05-271-1/+3
| | | | | | | | | | | | | | | This will address the common mistake many asyncio users make: an "except Exception" clause breaking Tasks cancellation. In addition to this change, we stop inheriting asyncio.TimeoutError and asyncio.InvalidStateError from their concurrent.futures.* counterparts. There's no point for these exceptions to share the inheritance chain. In 3.9 we'll focus on implementing supervisors and cancel scopes, which should allow better handling of all exceptions, including SystemExit and KeyboardInterrupt
* bpo-33530: Implement Happy Eyeballs in asyncio, v2 (GH-7237)twisteroid ambassador2019-05-051-1/+2
| | | | | | | | | | Added two keyword arguments, `delay` and `interleave`, to `BaseEventLoop.create_connection`. Happy eyeballs is activated if `delay` is specified. We now have documentation for the new arguments. `staggered_race()` is in its own module, but not exported to the main asyncio package. https://bugs.python.org/issue33530
* bpo-34622: Extract asyncio exceptions into a separate module (GH-9141)Andrew Svetlov2018-09-111-9/+2
|
* bpo-34270: Make it possible to name asyncio tasks (GH-8547)Alex Grönholm2018-08-081-1/+1
| | | Co-authored-by: Antti Haapala <antti.haapala@anttipatterns.com>
* bpo-33734: asyncio/ssl: a bunch of bugfixes (#7321)Yury Selivanov2018-06-041-3/+2
| | | | | | | * Fix AttributeError (not all SSL exceptions have 'errno' attribute) * Increase default handshake timeout from 10 to 60 seconds * Make sure start_tls can be cancelled correctly * Make sure any error in SSLProtocol gets propagated (instead of just being logged)
* Revert "bpo-22087: Fix Policy.get_event_loop() to detect fork (GH-7208)" (#7232)Yury Selivanov2018-05-301-7/+0
| | | This reverts commit 5d97b7bcc19496617bf8c448d2f149cc28c73bc7.
* bpo-22087: Fix Policy.get_event_loop() to detect fork (GH-7208)Yury Selivanov2018-05-291-0/+7
| | | | Original patch by Dan O'Reilly.
* Fix senfile typo (#6265)Sam Dunster2018-03-281-1/+1
| | | * Also in docs
* Implement TimerHandle.when() (#5473)Andrew Svetlov2018-02-011-0/+8
|
* bpo-32622: Implement loop.sendfile() (#5271)Andrew Svetlov2018-01-271-0/+8
|
* bpo-32662: Implement Server.start_serving() and Server.serve_forever() (#5312)Yury Selivanov2018-01-251-5/+43
| | | | | | | | | | | | | * bpo-32662: Implement Server.start_serving() and Server.serve_forever() New methods: * Server.start_serving(), * Server.serve_forever(), and * Server.is_serving(). Add 'start_serving' keyword parameter to loop.create_server() and loop.create_unix_server().