Commit Graph

170 Commits

Author SHA1 Message Date
Yury Selivanov bec2372b7e
bpo-32327: Revert loop.run_in_executor behaviour: return a Future. (#5392)
I've run some tests on 3.7 asyncio and it appears that too many
things assume that run_in_executor returns a Future.
2018-01-28 14:09:40 -05:00
Yury Selivanov b1a6ac4c40
bpo-32622: Enforce sendfile fallback policy for FALLBACK transports (#5364) 2018-01-27 15:52:52 -05:00
Andrew Svetlov 7c684073f9
bpo-32622: Implement loop.sendfile() (#5271) 2018-01-27 21:22:47 +02:00
Yury Selivanov c9070d03f5
bpo-32662: Implement Server.start_serving() and Server.serve_forever() (#5312)
* 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().
2018-01-25 18:08:09 -05:00
Yury Selivanov f23746a934
bpo-32436: Implement PEP 567 (#5027) 2018-01-22 19:11:18 -05:00
Yury Selivanov a4afcdfa55
bpo-32314: Fix asyncio.run() to cancel runinng tasks on shutdown (#5262) 2018-01-21 14:56:59 -05:00
Nathaniel J. Smith fc2f407829 bpo-32591: Add native coroutine origin tracking (#5250)
* Add coro.cr_origin and sys.set_coroutine_origin_tracking_depth
* Use coroutine origin information in the unawaited coroutine warning
* Stop using set_coroutine_wrapper in asyncio debug mode
* In BaseEventLoop.set_debug, enable debugging in the correct thread
2018-01-21 09:44:07 -05:00
Andrew Svetlov 7464e87a65
bpo-32410: Make SendfileNotAvailableError exception public (#5243) 2018-01-19 20:04:29 +02:00
Andrew Svetlov 6b5a27975a
bpo-32410: Implement loop.sock_sendfile() (#4976) 2018-01-16 19:59:34 +02:00
Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) 1634fc289a bpo-32418: Add get_loop() method on Server, AbstractServer classes (#4997)
* Add abstract get_loop() method to Server, AbstractServer classes.
* Add test cases for get_loop() method in Server, AbstractServer classes
* Add documentation for get_loop() method
2017-12-30 17:09:32 +02:00
Yury Selivanov f111b3dcb4
bpo-23749: Implement loop.start_tls() (#5039) 2017-12-30 00:35:36 -05:00
Yury Selivanov ca9b36cd1a
bpo-32415: Add asyncio.Task.get_loop() and Future.get_loop() (#4992) 2017-12-23 15:04:15 -05:00
Andrew Svetlov 51eb1c6b9c
bpo-29970: Make ssh_handshake_timeout None by default (#4939)
* Make ssh_handshake_timeout None by default.
* Raise ValueError if ssl_handshake_timeout is used without ssl.
* Raise ValueError if ssl_handshake_timeout is not positive.
2017-12-20 20:24:43 +02:00
Neil Aspinall f7686c1f55 bpo-29970: Add timeout for SSL handshake in asyncio
10 seconds by default.
2017-12-19 21:45:42 +02:00
Yury Selivanov 36c2c04478
bpo-32355: Optimize asyncio.gather() (#4913) 2017-12-19 07:19:53 -05:00
Yury Selivanov a7bd64c0c0
bpo-27456: Simplify sock type checks (#4922)
Recent sock.type fix (see bug 32331) makes sock.type checks simpler
in asyncio.
2017-12-19 06:44:37 -05:00
Yury Selivanov e796b2fe26
bpo-27456: Ensure TCP_NODELAY is set on linux (#4231) 2017-12-15 19:32:25 -05:00
Yury Selivanov 19a44f63c7
bpo-32327: Convert asyncio functions documented as coroutines to coroutines. (#4872) 2017-12-14 20:53:26 -05:00
Yury Selivanov 19d0d54809
bpo-32262: Fix f-string (#4787) 2017-12-10 19:52:53 -05:00
Yury Selivanov 6370f345e1
bpo-32262: Fix codestyle; use f-strings formatting where necessary. (#4775) 2017-12-10 18:36:12 -05:00
Andrew Svetlov 5f841b5538
bpo-32193: Convert asyncio to async/await usage (#4753)
* Convert asyncio/tasks.py to async/await

* Convert asyncio/queues.py to async/await

* Convert asyncio/test_utils.py to async/await

* Convert asyncio/base_subprocess.py to async/await

* Convert asyncio/subprocess.py to async/await

* Convert asyncio/streams.py to async/await

* Fix comments

* Convert asyncio/locks.py to async/await

* Convert asyncio.sleep to async def

* Add a comment

* Add missing news

* Convert stubs from AbstrctEventLoop to async functions

* Convert subprocess_shell/subprocess_exec

* Convert connect_read_pipe/connect_write_pip to async/await syntax

* Convert create_datagram_endpoint

* Convert create_unix_server/create_unix_connection

* Get rid of old style coroutines in unix_events.py

* Convert selector_events.py to async/await

* Convert wait_closed and create_connection

* Drop redundant line

* Convert base_events.py

* Code cleanup

* Drop redundant comments

* Fix indentation

* Add explicit tests for compatibility between old and new coroutines

* Convert windows event loop to use async/await

* Fix double awaiting of async function

* Convert asyncio/locks.py

* Improve docstring

* Convert tests to async/await

* Convert more tests

* Convert more tests

* Convert more tests

* Convert tests

* Improve test
2017-12-09 00:23:48 +02:00
Victor Stinner 28e61650b2
bpo-31245: asyncio: Fix typo, isistance => isinstance (#4594) 2017-11-28 00:34:08 +01:00
Victor Stinner 44862df2ee
bpo-32047: -X dev enables asyncio debug mode (#4418)
The new -X dev command line option now also enables asyncio debug
mode.
2017-11-20 07:14:07 -08:00
Antoine Pitrou 921e9432a1
bpo-31970: Reduce performance overhead of asyncio debug mode. (#4314)
* bpo-31970: Reduce performance overhead of asyncio debug mode.
2017-11-07 17:23:29 +01:00
Quentin Dawans fe4ea9cf1e bpo-31245: Asyncio unix socket datagram (#3164) 2017-10-30 09:43:02 -04:00
jimmylai 21b3e04c13 call remove_done_callback in finally section (#1688) 2017-05-22 22:32:46 -07:00
INADA Naoki 3e2ad8ec61 bpo-29617: Remove Python 3.3 support from asyncio (GH-232) 2017-04-25 10:57:18 +09:00
Serhiy Storchaka 2e576f5aec bpo-30144: Import collections ABC from collections.abc rather than collections. (#1263) 2017-04-24 09:05:00 +03:00
Serhiy Storchaka 5affd23e6f bpo-29762: More use "raise from None". (#569)
This hides unwanted implementation details from tracebacks.
2017-04-05 09:37:24 +03:00
Serhiy Storchaka 70d28a184c Remove unused imports. 2016-12-16 20:00:15 +02:00
Yury Selivanov 5cb0c09fa6 Merge 3.5 (issue #28652) 2016-11-21 17:47:41 -05:00
Yury Selivanov dab0584738 Issue #28652: Partially rollback previous changes
Allow AF_UNIX in create_server & create_connection
2016-11-21 17:47:27 -05:00
Yury Selivanov 954c7dd0cc Merge 3.5 (issue #28652) 2016-11-09 15:47:47 -05:00
Yury Selivanov a1a8b7d3d7 Issue #28652: Make loop methods reject socket kinds they do not support. 2016-11-09 15:47:00 -05:00
Yury Selivanov 69312fa4a2 Merge 3.5 (issue #28613) 2016-11-04 14:30:11 -04:00
Yury Selivanov 600a349781 Issue #28613: Fix get_event_loop() to return the current loop
when called from coroutines or callbacks.
2016-11-04 14:29:28 -04:00
Yury Selivanov c5420492cf asyncio: Sync with upstream 2016-11-03 15:35:23 -07:00
Yury Selivanov a6fbcd19ac Merge 3.5 (issue #28600) 2016-11-03 15:10:11 -07:00
Yury Selivanov 491a912659 Issue #28600: Optimize loop.call_soon().
Run expensive type checks only in debug mode.  In addition, stop
supporting passing handles to loop.run_in_executor.
2016-11-03 15:09:24 -07:00
Yury Selivanov a0c1ba608e Issue #28544: Implement asyncio.Task in C.
This implementation provides additional 10-20% speed boost for
asyncio programs.

The patch also fixes _asynciomodule.c to use Arguments Clinic, and
makes '_schedule_callbacks' an overridable method (as it was in 3.5).
2016-10-28 12:52:37 -04:00
Yury Selivanov 6330f2a5ce Merge 3.5 (issue #26796) 2016-10-21 17:41:23 -04:00
Yury Selivanov e8a6045fea Issue #26796: Don't configure the number of workers for default threadpool executor.
Initial patch by Hans Lawrenz.
2016-10-21 17:40:42 -04:00
Yury Selivanov ed0540698e Issue #28500: Fix asyncio to handle async gens GC from another thread. 2016-10-21 17:13:40 -04:00
Yury Selivanov d2c5fab7c6 Merge 3.5 (issue #28371) 2016-10-05 18:29:04 -04:00
Yury Selivanov 0de3de6cbf Issue #28371: Deprecate passing asyncio.Handles to run_in_executor. 2016-10-05 18:28:09 -04:00
Guido van Rossum 0035be3fee Misc asyncio improvements from upstream (merge 3.5->3.6) 2016-09-30 08:18:34 -07:00
Guido van Rossum e3c65a7a22 Misc asyncio improvements from upstream 2016-09-30 08:17:15 -07:00
Yury Selivanov 1b984ffd44 Merge 3.5 (issue #28174) 2016-09-15 15:46:16 -04:00
Yury Selivanov 5587d7c071 Issue #28174: Handle when SO_REUSEPORT isn't properly supported (asyncio)
Patch by Seth Michael Larson.
2016-09-15 15:45:07 -04:00
Yury Selivanov d070154fb5 Merge 3.5 (issue #27906) 2016-09-15 14:14:48 -04:00