Commit graph

235 commits

Author SHA1 Message Date
Victor Stinner
f67255ab94 Issue #20311: asyncio: Add a granularity attribute to BaseEventLoop: maximum
between the resolution of the BaseEventLoop.time() method and the resolution of
the selector. The granuarility is used in the scheduler to round time and
deadline.
2014-01-25 15:01:33 +01:00
Victor Stinner
421e49b5c1 asyncio: wait_for() now cancels the future on timeout. Patch written by Gustavo
Carneiro.
2014-01-23 17:40:59 +01:00
Victor Stinner
183e347796 asyncio (Tulip issue 110): StreamReader.read() and StreamReader.readline() now
raise a RuntimeError, instead of using an assertion, if another coroutine is
already waiting for incoming data
2014-01-23 17:40:03 +01:00
Victor Stinner
3eb45d3eae asyncio: Fix open_connection() documentation, writer is a StreamWriter 2014-01-23 10:20:18 +01:00
Victor Stinner
4a2dbeb0d3 asyncio: Cleanup logging in BaseEventLoop._run_once()
logger.log() is now responsible to format the timeout. It might be faster if
the log is disabled for DEBUG level, but it's also more readable and fix
an issue with Python 2.6 in the Trollius project.
2014-01-22 12:26:01 +01:00
Victor Stinner
22463aa947 Close #20275: Optimize BaseEventLoop._run_once()
Logger.log() is "slow", logger.isEnabledFor() is faster and the logger is
disabled in most cases. A microbenchmark executing 100,000 dummy tasks is 22%
faster with this change.
2014-01-20 23:56:40 +01:00
Guido van Rossum
e1f554490d asyncio: Reincarnate CoroWrapper's docstring as a comment. 2014-01-16 11:05:23 -08:00
Victor Stinner
bac7793b5b asyncio: Fix CoroWrapper (fix my previous commit)
Add __name__ and __doc__ to __slots__
2014-01-16 01:55:29 +01:00
Victor Stinner
4d7a29c5de asyncio: Fix a typo in CoroWrapper
__slot__ => __slots__
2014-01-16 01:38:24 +01:00
Victor Stinner
7de2646cdf Cleanup properly proactor event loop
* store the "self reading" future when the "self pipe" is closed (when the
  event loop is closed)
* store "accept" futures to cancel them when we stop serving
* close the "accept socket" if the "accept future" is cancelled

Fix many warnings which can be seen when unit tests are run in verbose mode.
2014-01-11 00:03:21 +01:00
Guido van Rossum
02757ea7e9 asyncio: Minimal pty support in UNIX read pipe, by Jonathan Slenders. 2014-01-10 13:30:04 -08:00
Guido van Rossum
4835f17c24 asyncio: Fix race in subprocess transport, by Victor Stinner. 2014-01-10 13:28:59 -08:00
Guido van Rossum
efef9d3f25 asyncio: Tiny cleanup in streams.py. 2014-01-10 13:26:38 -08:00
Guido van Rossum
2407f3bb1b asyncio: Don't special-case GeneratorExit in Condition.wait(). 2014-01-10 13:25:38 -08:00
Guido van Rossum
6188bd498f Fix typo in asyncio/streams.py. 2014-01-07 17:03:26 -08:00
Guido van Rossum
3845521b4b asyncio: Fix deadlock in readexactly(). Fixes issue #20154. 2014-01-06 16:09:18 -08:00
Victor Stinner
6f055e73df asyncio: make PY34 symbol private (rename it to _PY34) 2014-01-02 18:41:34 +01:00
Guido van Rossum
68816ef058 Export asyncio.iscoroutine[function]. 2013-12-28 08:06:40 -10:00
Guido van Rossum
68600c73bf asyncio: Fix space in log message about poll time. 2013-12-20 20:37:41 -08:00
Victor Stinner
e40c078627 Issue #19967: Defer the formating of the traceback in asyncio.Future destructor 2013-12-21 00:19:33 +01:00
Guido van Rossum
ac97bf4fd9 asyncio: Export all abstract protocol and transport classes. Fixes issue #20029. 2013-12-20 14:16:21 -08:00
Guido van Rossum
9ba75db3c5 asyncio: Clean up formatting. 2013-12-19 13:49:32 -08:00
Victor Stinner
4c3c699e62 Close #19967: Thanks to the PEP 442, asyncio.Future can use a destructor in
Python 3.4 to log "uncatched" exceptions, instead of the dedicated
_TracebackLogger class.
2013-12-19 22:42:40 +01:00
Guido van Rossum
994bf4332f Shorten lines. 2013-12-19 12:47:38 -08:00
Victor Stinner
2748bc735e asyncio: remove references to the Tulip project, rename Tulip to asyncio.
Patch written by Vajrasky Kok.
2013-12-13 10:57:04 +01:00
Victor Stinner
782b8e4b88 Remove a duplicated import 2013-12-07 15:02:09 +01:00
Guido van Rossum
1a605ed5a3 asyncio: Add Task.current_task() class method. 2013-12-06 12:57:40 -08:00
Christian Heimes
c9a87e6bbe fix cert names for asyncio test 2013-12-06 02:58:23 +01:00
Christian Heimes
6d8c1abb00 Issue #19509: Finish implementation of check_hostname
The new asyncio package now supports the new feature and comes with additional tests for SSL.
2013-12-06 00:23:13 +01:00
Charles-François Natali
74e7cf3f46 Issue #19850: asyncio: Set SA_RESTART when registering a signal handler to
limit EINTR occurrences.
2013-12-05 22:47:19 +01:00
Guido van Rossum
ebb8e58f0a asyncio: Write flow control for proactor event loop. 2013-12-04 12:12:07 -08:00
Victor Stinner
cf6f72e329 Fix typo in asyncio.AbstractServer documentation 2013-12-03 18:23:52 +01:00
Guido van Rossum
f10345e102 asyncio: Improve default writelines(). 2013-12-02 18:36:30 -08:00
Victor Stinner
10a8e6ab7b asyncio: replace our with asynchronous in docstring 2013-12-02 14:31:43 +01:00
Victor Stinner
c37dd614b6 asyncio: document locks 2013-12-02 14:31:16 +01:00
Charles-François Natali
b3330a0abf Issue #19842: Refactor BaseSelector to make it an actual usable ABC. 2013-12-01 11:04:17 +01:00
Guido van Rossum
9204af42cc asyncio: Use Interface instead of ABC. Fixes issue 19726. 2013-11-30 15:35:42 -08:00
Guido van Rossum
de3a1363a9 asyncio: Add 'shield' to __all__. 2013-11-29 09:29:00 -08:00
Guido van Rossum
a5062c5d81 asyncio: Change write buffer use to avoid O(N**2). Make write()/sendto() accept bytearray/memoryview too. Change some asserts with proper exceptions. 2013-11-27 14:12:48 -08:00
Guido van Rossum
cced076218 asyncio: Fix get_event_loop() to call set_event_loop() when setting the loop. By Anthony Baire. 2013-11-27 10:37:13 -08:00
Guido van Rossum
49c96fb7fa asyncio: Add StreamReaderProtocol to __all__. 2013-11-25 15:07:18 -08:00
Guido van Rossum
16c42391f1 asyncio: Fix docstring of get_nowait(). 2013-11-24 22:41:35 -08:00
Guido van Rossum
a58d1c32f8 asyncio: Add BoundedSemaphore to export list in locks.__all__. 2013-11-24 22:32:09 -08:00
Richard Oudkerk
71196e7f55 Issue #19740: Use WaitForSingleObject() instead of trusting TimerOrWaitFired. 2013-11-24 17:50:40 +00:00
Guido van Rossum
7fa6e1aeea Keep asyncio working with Python 3.3 too. 2013-11-23 15:36:43 -08:00
Guido van Rossum
085869bfee asyncio: Change bounded semaphore into a subclass, like threading.[Bounded]Semaphore. 2013-11-23 15:09:16 -08:00
Christian Heimes
67986f9431 Issue #19735: Implement private function ssl._create_stdlib_context() to
create SSLContext objects in Python's stdlib module. It provides a single
configuration point and makes use of SSLContext.load_default_certs().
2013-11-23 22:43:47 +01:00
Guido van Rossum
488b0da5da Fix typo. 2013-11-23 11:51:09 -08:00
Antoine Pitrou
dec43382c1 Fix transport docstrings 2013-11-23 12:30:00 +01:00
Guido van Rossum
7a465647e4 asyncio: Pass cancellation from wrapping Future to wrapped Future. By Saúl Ibarra Corretgé (mostly). 2013-11-22 11:47:22 -08:00