summaryrefslogtreecommitdiff
path: root/Lib/asyncio/base_events.py
Commit message (Collapse)AuthorAgeFilesLines
* [3.5] call remove_done_callback in finally section (GH-1688) (#1758)Łukasz Langa2017-05-231-1/+2
| | | (cherry picked from commit 21b3e04c13212b29e8c35ffc36eed8603fde08f4)
* Issue #28652: Partially rollback previous changesYury Selivanov2016-11-211-12/+10
| | | | Allow AF_UNIX in create_server & create_connection
* Issue #28652: Make loop methods reject socket kinds they do not support.Yury Selivanov2016-11-091-11/+45
|
* Issue #28613: Fix get_event_loop() to return the current loopYury Selivanov2016-11-041-1/+6
| | | | when called from coroutines or callbacks.
* asyncio: Sync with upstreamYury Selivanov2016-11-031-0/+3
|
* Issue #28600: Optimize loop.call_soon().Yury Selivanov2016-11-031-21/+19
| | | | | Run expensive type checks only in debug mode. In addition, stop supporting passing handles to loop.run_in_executor.
* Issue #26796: Don't configure the number of workers for default threadpool ↵Yury Selivanov2016-10-211-4/+1
| | | | | | executor. Initial patch by Hans Lawrenz.
* Issue #28371: Deprecate passing asyncio.Handles to run_in_executor.Yury Selivanov2016-10-051-0/+3
|
* Misc asyncio improvements from upstreamGuido van Rossum2016-09-301-18/+10
|
* Issue #28174: Handle when SO_REUSEPORT isn't properly supported (asyncio)Yury Selivanov2016-09-151-12/+13
| | | | Patch by Seth Michael Larson.
* Issue #27906: Fix socket accept exhaustion during high TCP traffic.Yury Selivanov2016-09-151-1/+1
| | | | Patch by Kevin Conway.
* Another asyncio sync.Yury Selivanov2016-09-151-4/+5
|
* asyncio: Sync with the upstreamYury Selivanov2016-09-151-0/+60
|
* Merge asyncio upstream.Guido van Rossum2016-09-091-1/+1
|
* Issue #27392: Add loop.connect_accepted_socket().Yury Selivanov2016-07-121-4/+24
| | | | Patch by Jim Fulton.
* Issue #27136: Fix DNS static resolution; don't use it in getaddrinfoYury Selivanov2016-06-081-69/+47
| | | | Patch by A. Jesse Jiryu Davis
* asyncio: Fix getaddrinfo to accept service names (for port)Yury Selivanov2016-06-021-3/+19
| | | | Patch by A. Jesse Jiryu Davis
* asyncio: Support host=b'' for getaddrinfoYury Selivanov2016-06-021-1/+1
|
* asyncio: Fix BytesWarning (use typed=True in lru_cache for _ipaddr_info)Yury Selivanov2016-05-211-1/+1
|
* asyncio: Fix getaddrinfo to accept None/str/bytes for 'port' argYury Selivanov2016-05-201-0/+5
| | | | Patch by A. Jesse Jiryu Davis.
* Issue #27041: asyncio: Add loop.create_future methodYury Selivanov2016-05-161-7/+11
|
* Issue #27040: Add loop.get_exception_handler methodYury Selivanov2016-05-161-0/+5
|
* asyncio: Don't log ConnectionAbortedErrorVictor Stinner2016-04-011-0/+6
| | | | | Issue #26509: In fatal error handlers, don't log ConnectionAbortedError which occur on Windows.
* asyncio: Remove duplicate bind addresses in create_server.Yury Selivanov2016-03-021-2/+5
| | | | Patch by Sebastien Bourdeauducq (issue #26338)
* asyncio: Skip getaddrinfo if host is already resolved.Yury Selivanov2015-12-161-39/+80
| | | | | | | | | | | | | getaddrinfo takes an exclusive lock on some platforms, causing clients to queue up waiting for the lock if many names are being resolved concurrently. Users may want to handle name resolution in their own code, for the sake of caching, using an alternate resolver, or to measure DNS duration separately from connection duration. Skip getaddrinfo if the "host" passed into create_connection is already resolved. See https://github.com/python/asyncio/pull/302 for details. Patch by A. Jesse Jiryu Davis.
* Issue #25593: Change semantics of EventLoop.stop().Guido van Rossum2015-11-191-16/+9
|
* Issue #23972: updates to asyncio datagram API. By Chris Laws.Guido van Rossum2015-10-051-66/+108
|
* Issue #23630, asyncio: host parameter of loop.create_server() can now be aVictor Stinner2015-09-211-7/+28
| | | | sequence of strings. Patch written by Yann Sionneau.
* asyncio: Sync with upstream (compat module)Yury Selivanov2015-08-041-1/+2
|
* asyncio: Sync with mainstreamYury Selivanov2015-08-041-1/+1
|
* asyncio: Make sure sys.set_coroutine_wrapper is called *only* when loop is ↵Yury Selivanov2015-05-121-35/+45
| | | | | | | | | | | | running. Previous approach of installing coroutine wrapper in loop.set_debug() and uninstalling it in loop.close() was very fragile. Most of asyncio tests do not call loop.close() at all. Since coroutine wrapper is a global setting, we have to make sure that it's only set when the loop is running, and is automatically unset when it stops running. Issue #24017.
* asyncio: Support PEP 492. Issue #24017.Yury Selivanov2015-05-111-9/+38
|
* asyncio: async() function is deprecated in favour of ensure_future().Yury Selivanov2015-05-111-1/+1
|
* Sync asyncio changes from the main repo.Yury Selivanov2015-05-111-11/+33
|
* asyncio: BaseEventLoop: rename _owner to _thread_idVictor Stinner2015-02-051-6/+6
|
* asyncio: Only call _check_resolved_address() in debug modeVictor Stinner2015-02-041-16/+32
| | | | | | | | | | | | | | | | * _check_resolved_address() is implemented with getaddrinfo() which is slow * If available, use socket.inet_pton() instead of socket.getaddrinfo(), because it is much faster Microbenchmark (timeit) on Fedora 21 (Python 3.4, Linux 3.17, glibc 2.20) to validate the IPV4 address "127.0.0.1" or the IPv6 address "::1": * getaddrinfo() 10.4 usec per loop * inet_pton(): 0.285 usec per loop On glibc older than 2.14, getaddrinfo() always requests the list of all local IP addresses to the kernel (using a NETLINK socket). getaddrinfo() has other known issues, it's better to avoid it when it is possible.
* Issue #23243, asyncio: Emit a ResourceWarning when an event loop or a transportVictor Stinner2015-01-291-0/+11
| | | | is not explicitly closed. Close also explicitly transports in test_sslproto.
* asyncio: sync with TulipVictor Stinner2015-01-281-1/+2
| | | | | | | | | | * Remove unused SSLProtocol._closing attribute * test_sslproto: skip test if ssl module is missing * Python issue #23208: Don't use the traceback of the current handle if we already know the traceback of the source. The handle may be more revelant, but having 3 tracebacks (handle, source, exception) becomes more difficult to read. The handle may be preferred later but it requires more work to make this choice.
* Issue #23208, asyncio: Add BaseEventLoop._current_handleVictor Stinner2015-01-261-6/+19
| | | | | | | | | In debug mode, BaseEventLoop._run_once() now sets the BaseEventLoop._current_handle attribute to the handle currently executed. In release mode or when no handle is executed, the attribute is None. BaseEventLoop.default_exception_handler() displays the traceback of the current handle if available.
* asyncio: Close transports on errorVictor Stinner2015-01-261-3/+21
| | | | | Fix create_datagram_endpoint(), connect_read_pipe() and connect_write_pipe(): close the transport if the task is cancelled or on error.
* asyncio: BaseEventLoop._create_connection_transport() catchs any exception, notVictor Stinner2015-01-221-1/+1
| | | | only Exception
* asyncio: pyflakes, remove unused importVictor Stinner2015-01-211-1/+1
| | | | tests: Remove unused function; inline another function
* asyncio: sync with TulipVictor Stinner2015-01-151-1/+6
| | | | | | | | | | | | | | | | | | | | | | | * PipeHandle now uses None instead of -1 for a closed handle * Sort imports in windows_utils. * Fix test_events on Python older than 3.5. Skip SSL tests on the ProactorEventLoop if ssl.MemoryIO is missing * Fix BaseEventLoop._create_connection_transport(). Close the transport if the creation of the transport (if the waiter) gets an exception. * _ProactorBasePipeTransport now sets _sock to None when the transport is closed. * Fix BaseSubprocessTransport.close(). Ignore pipes for which the protocol is not set yet (still equal to None). * TestLoop.close() now calls the close() method of the parent class (BaseEventLoop). * Cleanup BaseSelectorEventLoop: create the protocol on a separated line for readability and ease debugging. * Fix BaseSubprocessTransport._kill_wait(). Set the _returncode attribute, so close() doesn't try to terminate the process. * Tests: explicitly close event loops and transports * UNIX pipe transports: add closed/closing in repr(). Add "closed" or "closing" state in the __repr__() method of _UnixReadPipeTransport and _UnixWritePipeTransport classes.
* asyncio: Truncate to 80 columnsVictor Stinner2015-01-091-2/+2
|
* asyncio: _make_ssl_transport: make the waiter parameter optionalVictor Stinner2015-01-081-1/+1
|
* Issue #23046: Expose the BaseEventLoop class in the asyncio namespaceVictor Stinner2015-01-061-1/+1
|
* Issue #22926: In debug mode, call_soon(), call_at() and call_later() methods ofVictor Stinner2014-12-261-18/+20
| | | | | | | | | | asyncio.BaseEventLoop now use the identifier of the current thread to ensure that they are called from the thread running the event loop. Before, the get_event_loop() method was used to check the thread, and no exception was raised when the thread had no event loop. Now the methods always raise an exception in debug mode when called from the wrong thread. It should help to notice misusage of the API.
* Issue #23074: asyncio.get_event_loop() now raises an exception if the threadVictor Stinner2014-12-181-1/+1
| | | | has no event loop even if assertions are disabled.
* Closes #22429, asyncio: Fix EventLoop.run_until_complete(), don't stop theVictor Stinner2014-12-051-2/+12
| | | | | event loop if a BaseException is raised, because the event loop is already stopped.
* Closes #22922: More EventLoop methods fail if the loop is closed. Initial patchVictor Stinner2014-12-041-0/+4
| | | | | | | written by Torsten Landschoff. create_task(), call_at(), call_soon(), call_soon_threadsafe() and run_in_executor() now raise an error if the event loop is closed.